Remote Systems
v6.4.1

com.ibm.etools.systems.subsystems
Interface IRemoteFile

All Superinterfaces:
IRemoteContainer, IRemotePropertyHolder, ISystemContainer
All Known Subinterfaces:
IRemoteFileMutable
All Known Implementing Classes:
LocalFileImpl, RemoteFileImpl, UniversalFileImpl

public interface IRemoteFile
extends IRemoteContainer, IRemotePropertyHolder

This interface represents a handle to a remote file system object, which is either a file or a folder. This interface is similar to a java.io.File object, but with some significant differences:

Note for subsystem providers: this method does not capture the set methods that the RemoteFileImpl class defines. For that, cast to IRemoteFileMutable.


Field Summary
static char CONNECTION_DELIMITER
           
static String copyright
           
static boolean ISROOT_NO
           
static boolean ISROOT_YES
           
 
Method Summary
 boolean canRead()
          Returns true if the application can read this file.
 boolean canWrite()
          Returns true if the application can write to this file.
 int compareTo(Object other)
          Compare one remote file to another.
 boolean exists()
          Returns true if this folder or file actually exists.
 String getAbsolutePath()
          Get fully qualified name: root plus path plus name.
 String getAbsolutePathPlusConnection()
          Get fully qualified connection and file name: profile.connection\path\file.
 RemoteFileFilterString[] getAllFilterStrings()
          If this is a folder, it is possible that it is listed as part of a multiple filter string filter.
 String getCanonicalPath()
          Returns the canonical path of the remote file.
 String getClassification()
          Returns the classification of this file.
 String getComment()
           
 long getCompressedSize()
           
 String getCompressionMethod()
           
 double getCompressionRatio()
           
 long getExpandedSize()
           
 String getExtension()
          Return the extension part of a file name.
 Object getFile()
          Get the object.
 File getFileWrapper()
          Return an object extending java.io.File and proxing this file.
 RemoteFileFilterString getFilterString()
          Return the filter string resolved to get this object
 String getLabel()
          Get the display name for this file.
 long getLastModified()
          Returns the time (in milliseconds since epoch) this file was last modified.
 Date getLastModifiedDate()
          Return the last modified time as a Date object.
 long getLength()
          Returns the length, in bytes, of this file.
 String getLineSeparator()
          Return as a string the line separator for this file system Queries it from the subsystem factory.
 String getName()
          Get unqualified file name.
 String getParent()
          Get fully qualified path and name of folder containing this file or folder.
 String getParentName()
          Get the unqualified name of the parent directory containing this file or folder.
 String getParentNoRoot()
          Get fully qualified path and name of folder containing this file or folder, minus the root.
 IRemoteFile getParentRemoteFile()
          Return the parent remote file object expanded to get this object, or null if no such parent
 RemoteFileSubSystem getParentRemoteFileSubSystem()
          Get parent subsystem
 String getRoot()
          Get the root part of the name.
 String getSeparator()
          Return the separator character for this file system, as a string: "\" or "/".
 char getSeparatorChar()
          Return the separator character for this file system: \ or /.
 SystemConnection getSystemConnection()
          Return the connection this remote file is from.
 boolean isAncestorOf(IRemoteFile file)
          Note: if this remoteFile is the same as the file passed as parameter, then this method returns true.
 boolean isArchive()
          Returns true if this represents an archive file, versues a non-archive file
 boolean isBinary()
          Returns true if this is a binary file
 boolean isDescendantOf(IRemoteFile file)
          Note: if this remoteFile is the same as the file passed as parameter, then this method returns true.
 boolean isDirectory()
          Returns true if this represents a folder (eg: c:\\folder)
 boolean isExecutable()
          Returns whether the file is executable or not.
 boolean isFile()
          Returns true if this represents a file, versus a root or folder
 boolean isHidden()
          Returns true if this is a hidden file.
 boolean isLink()
          Returns whether the file is a symbolic link or not.
 boolean isRoot()
          Returns true if this represents a root folder (eg: c:\\ or /).
 boolean isText()
          Returns true if this is a text file
 boolean isVirtual()
          Returns true if this is a virtual file.
 void setFilterString(RemoteFileFilterString filterString)
          Set the filter string resolved to get this object
 boolean showBriefPropertySet()
          Querying properties for the property sheet can be expensive on some operating systems.
 boolean showReadOnlyProperty()
          Returns true if the ReadOnly Property should be shown in the property page.
 
Methods inherited from interface com.ibm.etools.systems.subsystems.IRemoteContainer
copyContentsTo, getContents, hasContents, replaceContent, setContents
 
Methods inherited from interface com.ibm.etools.systems.model.ISystemContainer
getContents, hasContents, isStale, markStale
 
Methods inherited from interface com.ibm.etools.systems.subsystems.IRemotePropertyHolder
getProperties, getProperty, isPropertyStale, markAllPropertiesStale, markPropertyStale, setProperties, setProperty
 

Field Detail

copyright

public static final String copyright
See Also:
Constant Field Values

CONNECTION_DELIMITER

public static final char CONNECTION_DELIMITER
See Also:
Constant Field Values

ISROOT_YES

public static final boolean ISROOT_YES
See Also:
Constant Field Values

ISROOT_NO

public static final boolean ISROOT_NO
See Also:
Constant Field Values
Method Detail

showBriefPropertySet

public boolean showBriefPropertySet()
Querying properties for the property sheet can be expensive on some operating systems. By default all properties are shown on the property sheet for this object, unless true is returned from this query, in which only a couple properties are shown.


getParentRemoteFileSubSystem

public RemoteFileSubSystem getParentRemoteFileSubSystem()
Get parent subsystem


getSeparatorChar

public char getSeparatorChar()
Return the separator character for this file system: \ or /. Queries it from the subsystem factory.


getSeparator

public String getSeparator()
Return the separator character for this file system, as a string: "\" or "/". Queries it from the subsystem factory.


getLineSeparator

public String getLineSeparator()
Return as a string the line separator for this file system Queries it from the subsystem factory.


getSystemConnection

public SystemConnection getSystemConnection()
Return the connection this remote file is from.


getParentRemoteFile

public IRemoteFile getParentRemoteFile()
Return the parent remote file object expanded to get this object, or null if no such parent


getFilterString

public RemoteFileFilterString getFilterString()
Return the filter string resolved to get this object


getAllFilterStrings

public RemoteFileFilterString[] getAllFilterStrings()
If this is a folder, it is possible that it is listed as part of a multiple filter string filter. In this case, when the folder is expanded, we want to filter the file names to show all the files that match any of the filter strings that have the same parent path.

This method supports that by returning all the filter strings in the filter which have the same parent path as was used to produce this file.


setFilterString

public void setFilterString(RemoteFileFilterString filterString)
Set the filter string resolved to get this object


getAbsolutePath

public String getAbsolutePath()
Get fully qualified name: root plus path plus name. No connection name.


getAbsolutePathPlusConnection

public String getAbsolutePathPlusConnection()
Get fully qualified connection and file name: profile.connection\path\file. Note the separator character between the profile name and the connection name is always '.' Note the separator character between the connection and qualified-file is always ':'


getLabel

public String getLabel()
Get the display name for this file. By default, this should be the same as the name If this object represents only a root drive, this is the same as getRoot().


getName

public String getName()
Get unqualified file name. No root and no path. If this object represents only a root drive, this is the same as getRoot().


getParent

public String getParent()
Get fully qualified path and name of folder containing this file or folder. Returns the root and path. No file name, and no ending separator.

If this object represent only a root drive, this returns null;

Example: c:\folder1\folder2\file1.ext results in c:\folder1\folder2


getParentNoRoot

public String getParentNoRoot()
Get fully qualified path and name of folder containing this file or folder, minus the root. Returns the path. No root prefix. No file name, and no ending separator.

If this object represent only a root drive, this returns null;

Example: c:\folder1\folder2\file1.ext results in folder1\folder2


getRoot

public String getRoot()
Get the root part of the name.


getParentName

public String getParentName()
Get the unqualified name of the parent directory containing this file or folder. Compare this to getParent() that returns the fully qualified parent directory. If this object represents only a root drive, this returns null.

Example: c:\folder1\folder2\file1.ext results in folder2


getExtension

public String getExtension()
Return the extension part of a file name. Eg, for abc.java, return "java"


isRoot

public boolean isRoot()
Returns true if this represents a root folder (eg: c:\\ or /).


isDirectory

public boolean isDirectory()
Returns true if this represents a folder (eg: c:\\folder)


isFile

public boolean isFile()
Returns true if this represents a file, versus a root or folder


isArchive

public boolean isArchive()
Returns true if this represents an archive file, versues a non-archive file


isBinary

public boolean isBinary()
Returns true if this is a binary file


isText

public boolean isText()
Returns true if this is a text file


isHidden

public boolean isHidden()
Returns true if this is a hidden file.


isVirtual

public boolean isVirtual()
Returns true if this is a virtual file.


canRead

public boolean canRead()
Returns true if the application can read this file.


canWrite

public boolean canWrite()
Returns true if the application can write to this file.


exists

public boolean exists()
Returns true if this folder or file actually exists.


getLastModified

public long getLastModified()
Returns the time (in milliseconds since epoch) this file was last modified.


getLastModifiedDate

public Date getLastModifiedDate()
Return the last modified time as a Date object.


getLength

public long getLength()
Returns the length, in bytes, of this file.


showReadOnlyProperty

public boolean showReadOnlyProperty()
Returns true if the ReadOnly Property should be shown in the property page.


getFileWrapper

public File getFileWrapper()
Return an object extending java.io.File and proxing this file. The resulting File object only supports the non-streaming, non static methods.


compareTo

public int compareTo(Object other)
              throws ClassCastException
Compare one remote file to another. This enables us to sort the files so they are shown folders-first, and in alphabetical order.

Throws:
ClassCastException

getFile

public Object getFile()
Get the object.


isAncestorOf

public boolean isAncestorOf(IRemoteFile file)
Note: if this remoteFile is the same as the file passed as parameter, then this method returns true.


isDescendantOf

public boolean isDescendantOf(IRemoteFile file)
Note: if this remoteFile is the same as the file passed as parameter, then this method returns true.


getCompressionRatio

public double getCompressionRatio()
Returns:
If this IRemoteFile is a virtual file, returns the actual minus compressed size divided by the actual size of this virtual file otherwise, returns 0.0.

getComment

public String getComment()
Returns:
Any comments stored with the file in the file system or archive.

getClassification

public String getClassification()
Returns the classification of this file. If the file is an executable, then "executable(...)" will be returned. If the file is a symbolic link then it will appear as "link(....):resolvedPath". The resolvedPath is the path that the link resolves to. A symbolic link that resolves to an executable would appear as "link(executable(...)):resolvedPath". By default this should just return "file".

Returns:
the classification.

isExecutable

public boolean isExecutable()
Returns whether the file is executable or not.

Returns:
true if the file is executable, false otherwise.

isLink

public boolean isLink()
Returns whether the file is a symbolic link or not.

Returns:
true if the file is a symbolic link, false otherwise.

getCanonicalPath

public String getCanonicalPath()
Returns the canonical path of the remote file.

Returns:
the resolved path if the file is a symbolic link, or

getCompressionMethod

public String getCompressionMethod()
Returns:
If this IRemoteFile is a virtual file, returns the method used to compress the file, otherwise, returns "".

getCompressedSize

public long getCompressedSize()
Returns:
if this IRemoteFile is a virtual file, returns the amount of actual space in the archive the file takes up after compression. If not a virtual file, returns the size of the IRemoteFile.

getExpandedSize

public long getExpandedSize()
Returns:
if this IRemoteFile is an archive, returns the sum of the actual size of all files within the archive (after expansion). If not an archive, returns the size of the IRemoteFile.

Remote Systems
v6.4.1

Copyright © 2005 IBM Corp. All Rights Reserved.

Note: This documentation is for part of an interim API that is still under development and expected to change significantly before reaching stability. It is being made available at this early stage to solicit feedback from pioneering adopters on the understanding that any code that uses this API will almost certainly be broken (repeatedly) as the API evolves.