RSE
Release 3.0

org.eclipse.rse.subsystems.files.core.subsystems
Interface IRemoteFile

All Superinterfaces:
IRemoteContainer, IRemotePropertyHolder, ISchedulingRule, ISystemContainer
All Known Subinterfaces:
IVirtualRemoteFile
All Known Implementing Classes:
RemoteFile

public interface IRemoteFile
extends IRemoteContainer, IRemotePropertyHolder, ISchedulingRule

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 RemoteFile class defines. For that, cast to RemoteFile.


Field Summary
static char CONNECTION_DELIMITER
           
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()
           
 String getEncoding()
          Returns the encoding of the remote file.
 String getExtension()
          Return the extension part of a file name.
 Object getFile()
          Get the object.
 RemoteFileFilterString getFilterString()
          Return the filter string resolved to get this object
 IHost getHost()
          Return the connection this remote file is from.
 IHostFile getHostFile()
           
 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 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.
 String getParentPath()
          Get fully qualified path and name of folder containing this file or folder.
 IRemoteFile getParentRemoteFile()
          Return the parent remote file object expanded to get this object, or null if no such parent exists.
 IRemoteFileSubSystem getParentRemoteFileSubSystem()
          Get parent subsystem.
 IHostFilePermissions getPermissions()
          Returns the permissions for this file if they exist
 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 /.
 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 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 org.eclipse.rse.core.subsystems.IRemoteContainer
copyContentsTo, getContents, hasContents, replaceContent, setContents
 
Methods inherited from interface org.eclipse.rse.core.model.ISystemContainer
getContents, hasContents, isStale, markStale, markStale
 
Methods inherited from interface org.eclipse.rse.core.subsystems.IRemotePropertyHolder
getProperties, getProperty, isPropertyStale, markAllPropertiesStale, markPropertyStale, setProperties, setProperty
 
Methods inherited from interface org.eclipse.core.runtime.jobs.ISchedulingRule
contains, isConflicting
 

Field Detail

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 IRemoteFileSubSystem getParentRemoteFileSubSystem()
Get parent subsystem.

Returns:
the Subsystem holding this file.

getSeparatorChar

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

Returns:
the separator character for this file system.

getSeparator

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

Returns:
the separator character for this file system as a String.

getLineSeparator

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


getHost

public IHost getHost()
Return the connection this remote file is from.

Since:
3.0 renamed getSystemConnection() to getHost()

getParentRemoteFile

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

Returns:
the parent remote file object or null.

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.


getAbsolutePath

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

Returns:
the fully qualified path for uniquely addressing this file on the remote host. Never returns null.

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().


getParentPath

public String getParentPath()
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.


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.


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.


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 "symbolic link(....):resolvedPath". The resolvedPath is the path that the link resolves to. A symbolic link that resolves to an executable would appear as "symbolic link(executable(...)):resolvedPath". By default this should just return "file" or "directory".

Returns:
the classification, or "unknown", or null if not classifiable.

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

getHostFile

public IHostFile getHostFile()

getEncoding

public String getEncoding()
Returns the encoding of the remote file.

Returns:
the encoding of the remote file.
Since:
2.0

getPermissions

public IHostFilePermissions getPermissions()
Returns the permissions for this file if they exist

Returns:
the permissions
Since:
3.0

RSE
Release 3.0

Copyright (c) IBM Corporation and others 2000, 2008. All Rights Reserved.