com.aptana.ide.core.io
Interface IVirtualFileManager

All Superinterfaces:
java.lang.Comparable, ISerializableSyncItem
All Known Implementing Classes:
FtpVirtualFileManager, LocalFileManager, ProjectFileManager, VirtualManagerBase

public interface IVirtualFileManager
extends java.lang.Comparable, ISerializableSyncItem

Author:
Paul Colton

Field Summary
 
Fields inherited from interface com.aptana.ide.core.io.sync.ISerializableSyncItem
DELIMITER, FILE_DELIMITER, OBJ_DELIMITER, SECTION_DELIMITER, TYPE_DELIMITER
 
Method Summary
 void addCloakedFile(IVirtualFile file)
          Sets a file as cloaked
 void addCloakExpression(java.lang.String fileExpression)
          Sets an expression to cloak all files that match the expression
 void connect()
          Establish a connection with the file manager
 boolean containsFile(IVirtualFile file)
          Does this file manager contain this particular file?
 boolean createLocalDirectory(IVirtualFile directoryFile)
          Creates a new directory within the file manager's file system
 IVirtualFile createVirtualDirectory(java.lang.String path)
          Creates a new virtual file for the specified directory path.
 IVirtualFile createVirtualFile(java.lang.String path)
          Creates a new virtual file for this specified path.
 boolean deleteFile(IVirtualFile file)
          Delete the specified file or directory from the file manager
 void disconnect()
          Break the connection with the file manager
 IVirtualFile getBaseFile()
          getBaseFile
 java.lang.String getBasePath()
          getBasePath
 java.lang.String[] getCloakedFileExpressions()
          getCloakedFileExpressions
 IVirtualFile[] getCloakedFiles()
          getCloakedFiles
 java.lang.String getDescriptiveLabel()
          Returns a descriptive label for use when presenting this file manager
 org.eclipse.swt.graphics.Image getDisabledImage()
          getIcon
 IVirtualFileManagerEventHandler getEventHandler()
          getEventHandler
 IVirtualFile[] getFiles(IVirtualFile file)
          getFiles
 IVirtualFile[] getFiles(IVirtualFile file, boolean recurse, boolean includeCloakedFiles)
          getFiles
 java.lang.String getFileSeparator()
          Get the string that is used to separate directories and files within a path
 java.lang.String getFileTimeString(IVirtualFile file)
          Returns the time of the file as a String.
 java.lang.String getGroup(IVirtualFile file)
          getGroup
 java.lang.String getHashString()
          Gets a string hash representation of this object.
 long getId()
          getId
 org.eclipse.swt.graphics.Image getImage()
          getIcon
 java.lang.String getNickName()
          Retrieve the name to use when displaying this file manager.
 java.lang.String getOwner(IVirtualFile file)
          getOwner
 ProtocolManager getProtocolManager()
          getProtocolManager
 java.io.InputStream getStream(IVirtualFile file)
          getStream
 long getTimeOffset()
          getTimeOffset
 boolean hasFiles(IVirtualFile file)
          Determines if this virtual file contains files
 boolean isAutoCalculateServerTimeOffset()
          Do we auto-calculate the server time offset
 boolean isConnected()
          Are we currently connected?
 boolean isFileCloaked(IVirtualFile file)
          is a file cloaked?
 boolean isHidden()
          isHidden
 boolean isTransient()
          isTransient
 boolean isValid()
          Is the current file manager valid (meaning that the base path is valid)
 boolean moveFile(IVirtualFile source, IVirtualFile destination)
          Move the virtual file to a new location
 void putStream(java.io.InputStream input, IVirtualFile targetFile)
          putStream
 void putToLocalFile(IVirtualFile file, java.io.File tempFile)
          getStream
 void refresh()
          refresh
 void removeCloakedFile(IVirtualFile file)
          Remove a file as cloaked
 void removeCloakExpression(java.lang.String fileExpression)
          Removes an expression to cloak all files that match the expression
 boolean renameFile(IVirtualFile file, java.lang.String newName)
          Rename a virtual file
 void resetTimeOffsetCache()
          Resets the time offset cache
 void resolveBasePath()
          resolveBasePath
 void setAutoCalculateServerTimeOffset(boolean calculateOffset)
          Set if we auto-calculate the server time offset
 void setBasePath(java.lang.String path)
          setBasePath
 void setCloakedFiles(IVirtualFile[] files)
          setCloakedFiles
 void setDisabledImage(org.eclipse.swt.graphics.Image image)
          setImage
 void setEventHandler(IVirtualFileManagerEventHandler eventHandler)
          setEventHandler
 void setGroup(IVirtualFile file, java.lang.String groupName)
          setGroup
 void setHidden(boolean hidden)
          setHidden
 void setId(long id)
          setId
 void setImage(org.eclipse.swt.graphics.Image image)
          setImage
 void setNickName(java.lang.String nickName)
          setNickName
 void setOwner(IVirtualFile file, java.lang.String ownerName)
          setOwner
 void setTimeOffset(long timeOffset)
          Sets the time offset
 void setTransient(boolean value)
          setTransient
 
Methods inherited from interface java.lang.Comparable
compareTo
 
Methods inherited from interface com.aptana.ide.core.io.sync.ISerializableSyncItem
fromSerializableString, getType, toSerializableString
 

Method Detail

getBaseFile

IVirtualFile getBaseFile()
getBaseFile

Returns:
The IVirtualFile of the basePath

getBasePath

java.lang.String getBasePath()
getBasePath

Returns:
String

setBasePath

void setBasePath(java.lang.String path)
setBasePath

Parameters:
path -

resolveBasePath

void resolveBasePath()
                     throws ConnectionException,
                            VirtualFileManagerException
resolveBasePath

Parameters:
path -
Throws:
ConnectionException
VirtualFileManagerException

getDescriptiveLabel

java.lang.String getDescriptiveLabel()
Returns a descriptive label for use when presenting this file manager

Returns:
a string used by various views. Often includes the path.

getEventHandler

IVirtualFileManagerEventHandler getEventHandler()
getEventHandler

Returns:
IVirtualFileManagerEventHandler

setEventHandler

void setEventHandler(IVirtualFileManagerEventHandler eventHandler)
setEventHandler

Parameters:
eventHandler -

getCloakedFiles

IVirtualFile[] getCloakedFiles()
getCloakedFiles

Returns:
IVirtualFile[]

getCloakedFileExpressions

java.lang.String[] getCloakedFileExpressions()
getCloakedFileExpressions

Returns:
String[]

setCloakedFiles

void setCloakedFiles(IVirtualFile[] files)
setCloakedFiles

Parameters:
files -

addCloakedFile

void addCloakedFile(IVirtualFile file)
Sets a file as cloaked

Parameters:
file -

addCloakExpression

void addCloakExpression(java.lang.String fileExpression)
Sets an expression to cloak all files that match the expression

Parameters:
fileExpression -

removeCloakedFile

void removeCloakedFile(IVirtualFile file)
Remove a file as cloaked

Parameters:
file -

removeCloakExpression

void removeCloakExpression(java.lang.String fileExpression)
Removes an expression to cloak all files that match the expression

Parameters:
fileExpression -

isFileCloaked

boolean isFileCloaked(IVirtualFile file)
is a file cloaked?

Parameters:
file -
Returns:
boolean

getFiles

IVirtualFile[] getFiles(IVirtualFile file)
                        throws ConnectionException,
                               java.io.IOException
getFiles

Parameters:
file -
includeCloakedFiles - do we include cloaked files in the list?
Returns:
IVirtualFile[]
Throws:
ConnectionException
java.io.IOException

getFiles

IVirtualFile[] getFiles(IVirtualFile file,
                        boolean recurse,
                        boolean includeCloakedFiles)
                        throws ConnectionException,
                               java.io.IOException
getFiles

Parameters:
file -
recurse -
includeCloakedFiles - do we include cloaked files in the list?
Returns:
IVirtualFile[]
Throws:
ConnectionException
java.io.IOException

hasFiles

boolean hasFiles(IVirtualFile file)
                 throws ConnectionException,
                        java.io.IOException
Determines if this virtual file contains files

Parameters:
file - The IVirtualFile to check for files against
Returns:
Returns true if this virtual file is a directory containing other files
Throws:
ConnectionException
java.io.IOException

getFileSeparator

java.lang.String getFileSeparator()
Get the string that is used to separate directories and files within a path

Returns:
Returns the file separator string

getFileTimeString

java.lang.String getFileTimeString(IVirtualFile file)
Returns the time of the file as a String.

Parameters:
file -
Returns:
String

getGroup

java.lang.String getGroup(IVirtualFile file)
getGroup

Parameters:
file -
Returns:
group name

setGroup

void setGroup(IVirtualFile file,
              java.lang.String groupName)
setGroup

Parameters:
file -
groupName -

getHashString

java.lang.String getHashString()
Gets a string hash representation of this object.

Returns:
String

setHidden

void setHidden(boolean hidden)
setHidden

Parameters:
hidden -

isHidden

boolean isHidden()
isHidden

Returns:
boolean

getId

long getId()
getId

Returns:
long

setId

void setId(long id)
setId

Parameters:
id -

getImage

org.eclipse.swt.graphics.Image getImage()
getIcon

Returns:
Icon

getDisabledImage

org.eclipse.swt.graphics.Image getDisabledImage()
getIcon

Returns:
Icon

setImage

void setImage(org.eclipse.swt.graphics.Image image)
setImage

Parameters:
image -

setDisabledImage

void setDisabledImage(org.eclipse.swt.graphics.Image image)
setImage

Parameters:
image -

getNickName

java.lang.String getNickName()
Retrieve the name to use when displaying this file manager. For example "www.myCoolWebSite.com"

Returns:
Returns this file manager's name

setNickName

void setNickName(java.lang.String nickName)
setNickName

Parameters:
nickName -

setTransient

void setTransient(boolean value)
setTransient

Parameters:
value -

isTransient

boolean isTransient()
isTransient

Returns:
boolean

getOwner

java.lang.String getOwner(IVirtualFile file)
getOwner

Parameters:
file -
Returns:
owner name

setOwner

void setOwner(IVirtualFile file,
              java.lang.String ownerName)
setOwner

Parameters:
file -
ownerName -

getProtocolManager

ProtocolManager getProtocolManager()
getProtocolManager

Returns:
Returns the protocol manager for this file manager

getTimeOffset

long getTimeOffset()
                   throws ConnectionException
getTimeOffset

Returns:
long
Throws:
ConnectionException

isConnected

boolean isConnected()
Are we currently connected?

Returns:
boolean

connect

void connect()
             throws ConnectionException
Establish a connection with the file manager

Throws:
ConnectionException

disconnect

void disconnect()
Break the connection with the file manager


containsFile

boolean containsFile(IVirtualFile file)
Does this file manager contain this particular file?

Parameters:
file - The file to check
Returns:
yes, if the file is "inside" this manager

createLocalDirectory

boolean createLocalDirectory(IVirtualFile directoryFile)
                             throws ConnectionException,
                                    VirtualFileManagerException
Creates a new directory within the file manager's file system

Parameters:
directoryFile - The path to the new directory
Returns:
Returns trues if the directory was created successfully.
Throws:
ConnectionException
VirtualFileManagerException

createVirtualDirectory

IVirtualFile createVirtualDirectory(java.lang.String path)
Creates a new virtual file for the specified directory path. Note that this does not create a directory within the file system

Parameters:
path - The path to the new virtual directory
Returns:
IVirtualFile Returns a virtual file for the new directory

createVirtualFile

IVirtualFile createVirtualFile(java.lang.String path)
Creates a new virtual file for this specified path. Note that this does not create a new file within the file system

Parameters:
path - The path to the new virtual file
Returns:
IVirtualFile Returns a virtual file for this new file

deleteFile

boolean deleteFile(IVirtualFile file)
                   throws ConnectionException,
                          VirtualFileManagerException
Delete the specified file or directory from the file manager

Parameters:
file - The virtual file to remove
Returns:
Returns true if the file was deleted successfully
Throws:
ConnectionException
VirtualFileManagerException

getStream

java.io.InputStream getStream(IVirtualFile file)
                              throws ConnectionException,
                                     VirtualFileManagerException,
                                     java.io.IOException
getStream

Parameters:
file -
Returns:
InputStream
Throws:
ConnectionException
VirtualFileManagerException
java.io.IOException

moveFile

boolean moveFile(IVirtualFile source,
                 IVirtualFile destination)
Move the virtual file to a new location

Parameters:
source - The source virtual file to move
destination - The destination location where to move the file
Returns:
Returns true if the file was moved successfully

putStream

void putStream(java.io.InputStream input,
               IVirtualFile targetFile)
               throws ConnectionException,
                      VirtualFileManagerException,
                      java.io.IOException
putStream

Parameters:
input - The input stream containing the data to store in the remote file
targetFile - The remote file where to store the data from the input stream
Throws:
ConnectionException
VirtualFileManagerException
java.io.IOException

putToLocalFile

void putToLocalFile(IVirtualFile file,
                    java.io.File tempFile)
                    throws ConnectionException,
                           VirtualFileManagerException
getStream

Parameters:
file -
tempFile -
Throws:
ConnectionException
VirtualFileManagerException

refresh

void refresh()
refresh


renameFile

boolean renameFile(IVirtualFile file,
                   java.lang.String newName)
                   throws ConnectionException,
                          VirtualFileManagerException
Rename a virtual file

Parameters:
file - The virtual file to rename
newName - The new name for the file
Returns:
Returns true if the rename was successful
Throws:
ConnectionException
VirtualFileManagerException

setTimeOffset

void setTimeOffset(long timeOffset)
Sets the time offset

Parameters:
timeOffset -

resetTimeOffsetCache

void resetTimeOffsetCache()
Resets the time offset cache


setAutoCalculateServerTimeOffset

void setAutoCalculateServerTimeOffset(boolean calculateOffset)
Set if we auto-calculate the server time offset

Parameters:
calculateOffset - do we calculate the offset

isAutoCalculateServerTimeOffset

boolean isAutoCalculateServerTimeOffset()
Do we auto-calculate the server time offset

Returns:
boolean

isValid

boolean isValid()
Is the current file manager valid (meaning that the base path is valid)

Returns:
boolean