org.millscript.commons.vfs
Interface VEntry

All Known Subinterfaces:
VFile, VFolder
All Known Implementing Classes:
AbstractChrootEntry, AbstractVEntry, AbstractVFile, AbstractVFolder, ChrootFile, ChrootFolder, FtpFile, FtpFolder, HttpFile, HttpFolder, LocalFile, LocalFolder, ReadOnlyZipFile, ReadOnlyZipFolder, StandardConsoleFile

public interface VEntry

This interface describes an entry in a virtual filesystem volume.


Method Summary
 java.lang.StringBuffer appendAbsolutePath(java.lang.StringBuffer buffer)
          Appends the absolute path to this entry to the specified string buffer.
 java.lang.StringBuffer appendAbsolutePathOnVolume(java.lang.StringBuffer buffer)
          Appends the absolute path to this entry, from the root folder of this entries volume, to the specified string buffer.
 java.lang.StringBuffer appendRelativePath(java.lang.StringBuffer buffer)
          Appends the relative path to this entry to the specified string buffer.
 java.lang.StringBuffer appendRelativePathOnVolume(java.lang.StringBuffer buffer)
          Appends the relative path to this entry, from the root folder of this entries volume, to the specified string buffer.
 java.lang.StringBuffer appendURI(java.lang.StringBuffer buffer)
          Appends the URI of this entry to the specified string buffer.
 boolean exists()
          Tests to see if the entry exits.
 java.lang.String getAbsolutePath()
          Returns the absolute path to this entry.
 java.lang.String getAbsolutePathOnVolume()
          Returns the absolute path to this entry, on this entries volume.
 java.lang.String getMIMEType(java.lang.String fileName)
          Returns the MIME type for the specified file name.
 MIMETypeHandler getMIMETypeHandler(java.lang.String type)
          Returns a MIME type handler for the specified type.
 java.lang.String getName()
          Returns the name of this entry in the filesystem.
 VFolder getParent()
          Returns the parent folder for this entry.
 java.lang.String getRelativePath()
          Returns the relative path to this entry.
 java.lang.String getRelativePathOnVolume()
          Returns the relative path to this entry, on this entries volume.
 java.net.URI getURI()
          Returns the URI for this virtual filesystem entry.
 VVolume getVolume()
          Returns the volume this entry is located on.
 VEntry toLocal()
          Returns this virtual entry as a local entry, which may simply be this object.
 

Method Detail

appendAbsolutePath

java.lang.StringBuffer appendAbsolutePath(java.lang.StringBuffer buffer)
Appends the absolute path to this entry to the specified string buffer. The path will be absolute path from the root volume.

Parameters:
buffer - the string buffer to append the path to
Returns:
the specified StringBuffer with this entries path appended to it

appendAbsolutePathOnVolume

java.lang.StringBuffer appendAbsolutePathOnVolume(java.lang.StringBuffer buffer)
Appends the absolute path to this entry, from the root folder of this entries volume, to the specified string buffer. The path will be absolute from the volume this entry belongs to.

Parameters:
buffer - the string buffer to append the path to
Returns:
the specified StringBuffer with this entries path appended to it

appendRelativePath

java.lang.StringBuffer appendRelativePath(java.lang.StringBuffer buffer)
Appends the relative path to this entry to the specified string buffer. The path will be relative from the root volume.

Parameters:
buffer - the string buffer to append the path to
Returns:
the specified StringBuffer with this entries path appended to it

appendRelativePathOnVolume

java.lang.StringBuffer appendRelativePathOnVolume(java.lang.StringBuffer buffer)
Appends the relative path to this entry, from the root folder of this entries volume, to the specified string buffer. The path will be relative from the volume this entry belongs to.

Parameters:
buffer - the string buffer to append the path to
Returns:
the specified StringBuffer with this entries path appended to it

appendURI

java.lang.StringBuffer appendURI(java.lang.StringBuffer buffer)
Appends the URI of this entry to the specified string buffer.

Parameters:
buffer - the string buffer to append the URI to
Returns:
the specified StringBuffer with this entries URI appended to it

exists

boolean exists()
Tests to see if the entry exits. This method is specific to the type of entry represented. For instance, if the entry is a file this method will only be true if the entry exists and is a file.

Returns:
true if this entry exits and false otherwise

getMIMEType

java.lang.String getMIMEType(java.lang.String fileName)
Returns the MIME type for the specified file name.

Parameters:
fileName - the file name to get a MIME type for
Returns:
a String holding the MIME type for the specified file name

getMIMETypeHandler

MIMETypeHandler getMIMETypeHandler(java.lang.String type)
Returns a MIME type handler for the specified type.

Parameters:
type - the MIME type to get a handler for
Returns:
a MIMETypeHandler for the specified type

getName

java.lang.String getName()
Returns the name of this entry in the filesystem.

Returns:
this entries name

getParent

VFolder getParent()
Returns the parent folder for this entry.

Returns:
the parent folder for this entry

getAbsolutePath

java.lang.String getAbsolutePath()
Returns the absolute path to this entry.

Returns:
the absolute path string for this entry

getAbsolutePathOnVolume

java.lang.String getAbsolutePathOnVolume()
Returns the absolute path to this entry, on this entries volume.

Returns:
the absolute path string for this entry

getRelativePath

java.lang.String getRelativePath()
Returns the relative path to this entry.

Returns:
the relative path string for this entry

getRelativePathOnVolume

java.lang.String getRelativePathOnVolume()
Returns the relative path to this entry, on this entries volume.

Returns:
the relative path string for this entry

getVolume

VVolume getVolume()
Returns the volume this entry is located on.

Returns:
the VVolume for this entry

getURI

java.net.URI getURI()
Returns the URI for this virtual filesystem entry.

Returns:
a URI for this entry

toLocal

VEntry toLocal()
Returns this virtual entry as a local entry, which may simply be this object. For example if this instance where a remote file accessed over HTTP, this method should cache the file and return a virtual file for that local copy.

Returns:
a VEntry for a local copy of this entry


Copyright © 2005-2007 Open World Ltd. All Rights Reserved.