com.aptana.ide.core.io
Interface IVirtualFile

All Superinterfaces:
java.lang.Comparable
All Known Implementing Classes:
FtpVirtualFile, LocalFile, VirtualFile

public interface IVirtualFile
extends java.lang.Comparable

Author:
Paul Colton

Method Summary
 boolean canRead()
          Determine if this virtual file is readable given the current set of permissions
 boolean canWrite()
          Determine if this virtual file is writable given the current set of permissions
 boolean delete()
          Remove this virtual file from the file manager
 void editProperties(org.eclipse.swt.widgets.Shell shell)
          editProperties
 boolean exists()
          Determine if this virtual file exists in it's file system
 java.lang.String getAbsolutePath()
          Get the path, filename and extension of this virtual file
 long getCreationMillis()
          Get the creation time of this file in milliseconds
 java.lang.String getExtension()
          Get the extension for this virtual file
 IVirtualFileManager getFileManager()
          Get the file manager that this file belongs to
 IVirtualFile[] getFiles()
          Retrieve a list of files contained by this virtual file
 IVirtualFile[] getFiles(boolean recurse, boolean includeCloakedFiles)
          Retrieve a list of files contained by this virtual file
 java.lang.String getGroup()
          Get the group to which this file belongs
 org.eclipse.swt.graphics.Image getImage()
          getImage
 long getModificationMillis()
          Get the modification time of this file in milliseconds
 java.lang.String getName()
          Get the filename and extension of this virtual file.
 java.lang.String getOwner()
          Get the owner of this file
 IVirtualFile getParentFile()
          Retrieve the virtual file that contains file file
 java.lang.String getPath()
          Doesn't include filename and extension.
 long getPermissions()
          Get the file permissions for this file
 java.lang.String getRelativePath()
          Returns a path relative to the parent virtual file manager
 long getSize()
          getSize
 java.io.InputStream getStream()
          Get an input stream for the contents of this virtual file
 java.lang.String getTimeStamp()
          Gets the raw time stamp for the file
 boolean hasFiles()
          Determines if this virtual file contains files
 boolean isCloaked()
          Is this file cloaked?
 boolean isDirectory()
          Determines if this virtual file represents a directory
 boolean isFile()
          Determines if this virtual file represents a file
 boolean isLocal()
          Is this file local?
 void putStream(java.io.InputStream input)
          Put the content of the specified input stream into this virtual file.
 boolean rename(java.lang.String newName)
          Rename this file
 void setCloaked(boolean cloak)
          Set the file as cloaked or not
 void setGroup(java.lang.String group)
          Change this file's group name
 void setImage(org.eclipse.swt.graphics.Image image)
          setImage
 void setModificationMillis(long modificationTime)
          Sets the modification time of this file in milliseconds
 void setOwner(java.lang.String owner)
          Change this file's owner
 void setPermissions(long permissions)
          Set the file permissions on this file
 void setTimeStamp(java.lang.String timeStamp)
          Sets the raw time stamp
 
Methods inherited from interface java.lang.Comparable
compareTo
 

Method Detail

editProperties

void editProperties(org.eclipse.swt.widgets.Shell shell)
editProperties


getCreationMillis

long getCreationMillis()
Get the creation time of this file in milliseconds

Returns:
long

isDirectory

boolean isDirectory()
Determines if this virtual file represents a directory

Returns:
Returns true if this virtual file is a directory

isFile

boolean isFile()
Determines if this virtual file represents a file

Returns:
Returns true if this virtual file is a file

getExtension

java.lang.String getExtension()
Get the extension for this virtual file

Returns:
Returns the file extension including the leading '.'

setCloaked

void setCloaked(boolean cloak)
Set the file as cloaked or not

Parameters:
cloak -

isCloaked

boolean isCloaked()
Is this file cloaked?

Returns:
boolean

isLocal

boolean isLocal()
Is this file local?

Returns:
boolean

getFiles

IVirtualFile[] getFiles()
                        throws ConnectionException,
                               java.io.IOException
Retrieve a list of files contained by this virtual file

Returns:
Returns an array of virtual files. This will return an empty array if this virtual file contains no other files
Throws:
ConnectionException
java.io.IOException

getFiles

IVirtualFile[] getFiles(boolean recurse,
                        boolean includeCloakedFiles)
                        throws ConnectionException,
                               java.io.IOException
Retrieve a list of files contained by this virtual file

Parameters:
recurse - Do we recurse through sub-directories?
includeCloakedFiles - Do we include cloaked files in the list?
Returns:
Returns an array of virtual files. This will return an empty array if this virtual file contains no other files
Throws:
ConnectionException
java.io.IOException

hasFiles

boolean hasFiles()
Determines if this virtual file contains files

Returns:
Returns true if this virtual file is a directory containing other files

getAbsolutePath

java.lang.String getAbsolutePath()
Get the path, filename and extension of this virtual file

Returns:
Returns the full path, name, and extension for this file

getFileManager

IVirtualFileManager getFileManager()
Get the file manager that this file belongs to

Returns:
Returns this file's owning file manager

getGroup

java.lang.String getGroup()
Get the group to which this file belongs

Returns:
This file's group name

setGroup

void setGroup(java.lang.String group)
Change this file's group name

Parameters:
group -

getImage

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

Returns:
Image

setImage

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

Parameters:
image -

getModificationMillis

long getModificationMillis()
Get the modification time of this file in milliseconds

Returns:
long

getTimeStamp

java.lang.String getTimeStamp()
Gets the raw time stamp for the file

Returns:
- time string

setTimeStamp

void setTimeStamp(java.lang.String timeStamp)
Sets the raw time stamp

Parameters:
timeStamp -

setModificationMillis

void setModificationMillis(long modificationTime)
                           throws java.io.IOException,
                                  ConnectionException
Sets the modification time of this file in milliseconds

Parameters:
modificationTime -
Throws:
java.io.IOException
ConnectionException

getName

java.lang.String getName()
Get the filename and extension of this virtual file. This should exclude the parent directory of the file

Returns:
Returns this virtual file's name and extension

getOwner

java.lang.String getOwner()
Get the owner of this file

Returns:
This file's group name

setOwner

void setOwner(java.lang.String owner)
Change this file's owner

Parameters:
owner -

getParentFile

IVirtualFile getParentFile()
Retrieve the virtual file that contains file file

Returns:
Returns this file's parent file

getPath

java.lang.String getPath()
Doesn't include filename and extension. Includes trailing file separator

Returns:
Returns the path to this virtual file

setPermissions

void setPermissions(long permissions)
Set the file permissions on this file

Parameters:
permissions - The new file permission settings

getPermissions

long getPermissions()
Get the file permissions for this file

Returns:
Returns the file permissions settings for this file

getSize

long getSize()
getSize

Returns:
long

getStream

java.io.InputStream getStream()
                              throws ConnectionException,
                                     VirtualFileManagerException,
                                     java.io.IOException
Get an input stream for the contents of this virtual file

Returns:
Returns an InputStream of null
Throws:
ConnectionException
VirtualFileManagerException
java.io.IOException

putStream

void putStream(java.io.InputStream input)
               throws ConnectionException,
                      VirtualFileManagerException,
                      java.io.IOException
Put the content of the specified input stream into this virtual file. This will create a new file if it does not already exist. This will replace the entire content of the file if it does exist

Parameters:
input - The input stream from which to retrieve data to place into this virtual file
Throws:
ConnectionException
VirtualFileManagerException
java.io.IOException

canRead

boolean canRead()
Determine if this virtual file is readable given the current set of permissions

Returns:
Returns true if this virtual file is readable

canWrite

boolean canWrite()
Determine if this virtual file is writable given the current set of permissions

Returns:
Returns true if this virtual file is writable

delete

boolean delete()
               throws ConnectionException,
                      VirtualFileManagerException
Remove this virtual file from the file manager

Returns:
Returns true if the file was successfully deleted
Throws:
ConnectionException
VirtualFileManagerException

exists

boolean exists()
               throws ConnectionException
Determine if this virtual file exists in it's file system

Returns:
Returns true if the file exists
Throws:
ConnectionException

rename

boolean rename(java.lang.String newName)
               throws ConnectionException,
                      VirtualFileManagerException
Rename this file

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

getRelativePath

java.lang.String getRelativePath()
Returns a path relative to the parent virtual file manager

Returns:
A relative path, or "/" if it is the root.