|
 |
|
|
org.eclipse.rse.subsystems.files.core.subsystems
Interface IRemoteFile
-
All Superinterfaces:
-
IRemoteContainer,
IRemotePropertyHolder,
ISchedulingRule,
ISystemContainer
-
All Known Subinterfaces:
-
IVirtualRemoteFile
-
All Known Implementing Classes:
-
AbstractRemoteFile,
RemoteFile,
RemoteFileEmpty,
RemoteFileRoot
-
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:
- This represents a "handle" to the remote file or folder, and allows to
mark special folders as "root" of the file system. For editing purposes,
a local copy of the remote file can be managed. The support for this is
captured in a separate interface,
ISystemEditableRemoteObject .
- This interface has no action methods, only property access methods. The action methods
such as delete, rename, list or getRemoteFileObject() are found in the
IRemoteFileSubSystem interface. All remote commands/actions are routed
through subsystems in this remote system framework.
- Similarly, IRemoteFile handle objects are not constructed directly. They are obtained
from factory methods in
IRemoteFileSubSystem.getRemoteFileObject(String, org.eclipse.core.runtime.IProgressMonitor) ,
and related methods, which may delegate the actual object creation to an
IHostFileToRemoteFileAdapter in case of an
IFileServiceSubSystem
instance.
- There are no relative names. All names are fully qualified, and include
the root, the path and the file name (unless this is a folder).
- There are additional methods for querying the root (ie, c:\) and the
parent directory (unqualified name of the parent directory).
Note for subsystem providers: this method does not capture the set methods that the
RemoteFile class defines. For that, cast to
RemoteFile .
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. |
CONNECTION_DELIMITER
static final char CONNECTION_DELIMITER
-
See Also:
-
Constant Field Values
ISROOT_YES
static final boolean ISROOT_YES
-
See Also:
-
Constant Field Values
ISROOT_NO
static final boolean ISROOT_NO
-
See Also:
-
Constant Field Values
showBriefPropertySet
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
IRemoteFileSubSystem getParentRemoteFileSubSystem()
- Get parent subsystem.
-
-
-
Returns:
- the Subsystem holding this file.
getSeparatorChar
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
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
String getLineSeparator()
- Return as a string the line separator for this file system
Queries it from the subsystem factory.
-
-
getHost
IHost getHost()
- Return the connection this remote file is from.
-
-
-
Since:
- 3.0 renamed getSystemConnection() to getHost()
getParentRemoteFile
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
RemoteFileFilterString getFilterString()
- Return the filter string resolved to get this object
-
-
getAllFilterStrings
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
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
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
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
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
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
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
String getRoot()
- Get the root part of the name.
- Example:
c:\folder1\folder2\file1.ext results in c:\
- Example:
/folder1/folder2/file1.ext results in /
-
-
getParentName
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
String getExtension()
- Return the extension part of a file name.
Eg, for abc.java, return "java"
-
-
isRoot
boolean isRoot()
- Returns true if this represents a root folder (eg: c:\\ or /).
-
-
isDirectory
boolean isDirectory()
- Returns true if this represents a folder (eg: c:\\folder)
-
-
isFile
boolean isFile()
- Returns true if this represents a file, versus a root or folder
-
-
isArchive
boolean isArchive()
- Returns true if this represents an archive file, versues a non-archive file
-
-
isBinary
boolean isBinary()
- Returns true if this is a binary file
-
-
isText
boolean isText()
- Returns true if this is a text file
-
-
isHidden
boolean isHidden()
- Returns true if this is a hidden file.
-
-
canRead
boolean canRead()
- Returns true if the application can read this file.
-
-
canWrite
boolean canWrite()
- Returns true if the application can write to this file.
-
-
exists
boolean exists()
- Returns true if this folder or file actually exists.
-
-
getLastModified
long getLastModified()
- Returns the time (in milliseconds since epoch) this file was last modified.
-
-
getLastModifiedDate
Date getLastModifiedDate()
- Return the last modified time as a Date object.
-
-
getLength
long getLength()
- Returns the length, in bytes, of this file.
-
-
showReadOnlyProperty
boolean showReadOnlyProperty()
- Returns true if the ReadOnly Property should be shown in the property page.
-
-
compareTo
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
Object getFile()
- Get the object.
-
-
isAncestorOf
boolean isAncestorOf(
IRemoteFile file)
- Note: if this remoteFile is the same as the file passed
as parameter, then this method returns true.
-
-
isDescendantOf
boolean isDescendantOf(
IRemoteFile file)
- Note: if this remoteFile is the same as the file passed
as parameter, then this method returns true.
-
-
getComment
String getComment()
-
-
-
Returns:
- Any comments stored with the file in the file system or archive.
getClassification
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
boolean isExecutable()
- Returns whether the file is executable or not.
-
-
-
Returns:
-
true if the file is executable, false otherwise.
isLink
boolean isLink()
- Returns whether the file is a symbolic link or not.
-
-
-
Returns:
-
true if the file is a symbolic link, false otherwise.
getCanonicalPath
String getCanonicalPath()
- Returns the canonical path of the remote file.
-
-
-
Returns:
- the resolved path if the file is a symbolic link, or
getHostFile
IHostFile getHostFile()
-
-
getEncoding
String getEncoding()
- Returns the encoding of the remote file.
-
-
-
Returns:
- the encoding of the remote file.
-
Since:
- 2.0
getPermissions
IHostFilePermissions getPermissions()
- Returns the permissions for this file if they exist
-
-
-
Returns:
- the permissions
-
Since:
- 3.0
Copyright (c) IBM Corporation and others 2000, 2008. All Rights Reserved.
|
|
|