RSE
Release 1.0

org.eclipse.rse.subsystems.files.core.servicesubsystem
Class AbstractRemoteFile

java.lang.Object
  extended byorg.eclipse.rse.subsystems.files.core.subsystems.RemoteFile
      extended byorg.eclipse.rse.subsystems.files.core.servicesubsystem.AbstractRemoteFile
All Implemented Interfaces:
Cloneable, Comparable, IAdaptable, IRemoteContainer, IRemoteFile, IRemotePropertyHolder, ISchedulingRule, ISystemContainer
Direct Known Subclasses:
DStoreFile, FTPRemoteFile, LocalFile, SftpRemoteFile

public abstract class AbstractRemoteFile
extends RemoteFile
implements IRemoteFile


Field Summary
protected  String _classiciation
           
protected  IHostFile _hostFile
           
protected  FileServiceSubSystem _subSystem
           
 
Fields inherited from class org.eclipse.rse.subsystems.files.core.subsystems.RemoteFile
_contents, _context, _isStale, _label, _parentFile, fullyQualifiedName, isContainer, properties, propertyStates, remoteObj
 
Fields inherited from interface org.eclipse.rse.subsystems.files.core.subsystems.IRemoteFile
CONNECTION_DELIMITER, ISROOT_NO, ISROOT_YES
 
Constructor Summary
AbstractRemoteFile(FileServiceSubSystem subSystem, IRemoteFileContext context, IRemoteFile parent, IHostFile hostFile)
           
 
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.
 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.
 long getLength()
          Returns the length, in bytes, of this file.
 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.
 IRemoteFileSubSystem getParentRemoteFileSubSystem()
          Get parent subsystem
 String getRoot()
          Get the root part of the name.
 IHost getSystemConnection()
          Return the connection this remote file is from.
 boolean isDirectory()
          Returns true if this represents a folder (eg: c:\\folder)
 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 isRoot()
          Returns true if this represents a root folder (eg: c:\\ or /).
 boolean isVirtual()
           
 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 class org.eclipse.rse.subsystems.files.core.subsystems.RemoteFile
contains, containsFilterKey, copyContentsTo, equals, getAbsolutePathPlusConnection, getAdapter, getAllFilterStrings, getComment, getContents, getContents, getContext, getExtension, getFile, getFilterString, getHostName, getLastModifiedDate, getLineSeparator, getParentRemoteFile, getParentRemoteFileSubSystemConfiguration, getProperties, getProperty, getSeparator, getSeparatorChar, hasContents, hasContents, isAncestorOf, isArchive, isBinary, isConflicting, isDescendantOf, isExecutable, isLink, isPropertyStale, isStale, isText, isUnix, markAllPropertiesStale, markPropertyStale, markStale, markStale, replaceContent, setContents, setFile, setFilterString, setIsContainer, setLabel, setParentRemoteFile, setProperties, setProperty, toString
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface org.eclipse.rse.subsystems.files.core.subsystems.IRemoteFile
getAbsolutePathPlusConnection, getAllFilterStrings, getCanonicalPath, getClassification, getComment, getExtension, getFile, getFilterString, getLastModifiedDate, getLineSeparator, getParentRemoteFile, getSeparator, getSeparatorChar, isAncestorOf, isArchive, isBinary, isDescendantOf, isExecutable, isLink, isText
 
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

_hostFile

protected IHostFile _hostFile

_subSystem

protected FileServiceSubSystem _subSystem

_classiciation

protected String _classiciation
Constructor Detail

AbstractRemoteFile

public AbstractRemoteFile(FileServiceSubSystem subSystem,
                          IRemoteFileContext context,
                          IRemoteFile parent,
                          IHostFile hostFile)
Method Detail

getParentRemoteFileSubSystem

public IRemoteFileSubSystem getParentRemoteFileSubSystem()
Description copied from interface: IRemoteFile
Get parent subsystem

Specified by:
getParentRemoteFileSubSystem in interface IRemoteFile
Overrides:
getParentRemoteFileSubSystem in class RemoteFile

getSystemConnection

public IHost getSystemConnection()
Description copied from interface: IRemoteFile
Return the connection this remote file is from.

Specified by:
getSystemConnection in interface IRemoteFile
Overrides:
getSystemConnection in class RemoteFile

getAbsolutePath

public String getAbsolutePath()
Description copied from interface: IRemoteFile
Get fully qualified name: root plus path plus name. No connection name.

Specified by:
getAbsolutePath in interface IRemoteFile
Overrides:
getAbsolutePath in class RemoteFile
See Also:
IRemoteFile.getAbsolutePath()

getLabel

public String getLabel()
Description copied from interface: IRemoteFile
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().

Specified by:
getLabel in interface IRemoteFile
Overrides:
getLabel in class RemoteFile
See Also:
IRemoteFile.getLabel()

getName

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

Specified by:
getName in interface IRemoteFile

getParentPath

public String getParentPath()
Description copied from interface: IRemoteFile
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

Specified by:
getParentPath in interface IRemoteFile

isRoot

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

Specified by:
isRoot in interface IRemoteFile

isDirectory

public boolean isDirectory()
Description copied from interface: IRemoteFile
Returns true if this represents a folder (eg: c:\\folder)

Specified by:
isDirectory in interface IRemoteFile

isFile

public boolean isFile()
Description copied from interface: IRemoteFile
Returns true if this represents a file, versus a root or folder

Specified by:
isFile in interface IRemoteFile

exists

public boolean exists()
Description copied from interface: IRemoteFile
Returns true if this folder or file actually exists.

Specified by:
exists in interface IRemoteFile

getLastModified

public long getLastModified()
Description copied from interface: IRemoteFile
Returns the time (in milliseconds since epoch) this file was last modified.

Specified by:
getLastModified in interface IRemoteFile

getLength

public long getLength()
Description copied from interface: IRemoteFile
Returns the length, in bytes, of this file.

Specified by:
getLength in interface IRemoteFile

compareTo

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

Specified by:
compareTo in interface IRemoteFile
Overrides:
compareTo in class RemoteFile
Throws:
ClassCastException

showBriefPropertySet

public boolean showBriefPropertySet()
Description copied from interface: IRemoteFile
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.

Specified by:
showBriefPropertySet in interface IRemoteFile

getParentNoRoot

public String getParentNoRoot()
Deprecated. - shouldn't need apis like this

Description copied from interface: IRemoteFile
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

Specified by:
getParentNoRoot in interface IRemoteFile

getRoot

public String getRoot()
Deprecated. - shouldn't need apis like this

Description copied from interface: IRemoteFile
Get the root part of the name.

Specified by:
getRoot in interface IRemoteFile

getParentName

public String getParentName()
Description copied from interface: IRemoteFile
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

Specified by:
getParentName in interface IRemoteFile

isHidden

public boolean isHidden()
Description copied from interface: IRemoteFile
Returns true if this is a hidden file.

Specified by:
isHidden in interface IRemoteFile

isVirtual

public boolean isVirtual()

canRead

public boolean canRead()
Description copied from interface: IRemoteFile
Returns true if the application can read this file.

Specified by:
canRead in interface IRemoteFile

canWrite

public boolean canWrite()
Description copied from interface: IRemoteFile
Returns true if the application can write to this file.

Specified by:
canWrite in interface IRemoteFile

showReadOnlyProperty

public boolean showReadOnlyProperty()
Description copied from interface: IRemoteFile
Returns true if the ReadOnly Property should be shown in the property page.

Specified by:
showReadOnlyProperty in interface IRemoteFile

getHostFile

public IHostFile getHostFile()
Specified by:
getHostFile in interface IRemoteFile

RSE
Release 1.0

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