org.millscript.commons.vfs.util
Class StandardConsoleFile

java.lang.Object
  extended by org.millscript.commons.vfs.util.StandardConsoleFile
All Implemented Interfaces:
VEntry, VFile

public class StandardConsoleFile
extends java.lang.Object
implements VFile

The standard system console as a virtual file. I'm not sure how useful this really is, or how technically correct.


Constructor Summary
StandardConsoleFile()
           
 
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.io.OutputStream getAppendOutputStream()
          Returns an output stream for appending to the existing file contents.
 java.io.Writer getAppendWriter()
          Returns a writer for appending to the existing file contents.
 java.lang.String getContentMIMEType()
          Returns the MIME type for the contents of this file.
 java.io.InputStream getInputStream()
          Returns an input stream for reading the file contents.
 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.
 java.io.OutputStream getOutputStream()
          Returns an ouptut stream for writing the file contents.
 VFolder getParent()
          Returns the parent folder for this entry.
 java.io.Reader getReader()
          Returns a reader for reading the file contents.
 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.
 java.io.Writer getWriter()
          Returns a writer for writing the file contents.
 VFile toLocal()
          Returns this virtual entry as a local entry, which may simply be this object.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

StandardConsoleFile

public StandardConsoleFile()
Method Detail

appendAbsolutePath

public java.lang.StringBuffer appendAbsolutePath(java.lang.StringBuffer buffer)
Description copied from interface: VEntry
Appends the absolute path to this entry to the specified string buffer. The path will be absolute path from the root volume.

Specified by:
appendAbsolutePath in interface VEntry
Parameters:
buffer - the string buffer to append the path to
Returns:
the specified StringBuffer with this entries path appended to it
See Also:
VEntry.appendAbsolutePath(java.lang.StringBuffer)

appendAbsolutePathOnVolume

public java.lang.StringBuffer appendAbsolutePathOnVolume(java.lang.StringBuffer buffer)
Description copied from interface: VEntry
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.

Specified by:
appendAbsolutePathOnVolume in interface VEntry
Parameters:
buffer - the string buffer to append the path to
Returns:
the specified StringBuffer with this entries path appended to it
See Also:
VEntry.appendAbsolutePathOnVolume(java.lang.StringBuffer)

appendRelativePath

public java.lang.StringBuffer appendRelativePath(java.lang.StringBuffer buffer)
Description copied from interface: VEntry
Appends the relative path to this entry to the specified string buffer. The path will be relative from the root volume.

Specified by:
appendRelativePath in interface VEntry
Parameters:
buffer - the string buffer to append the path to
Returns:
the specified StringBuffer with this entries path appended to it
See Also:
VEntry.appendRelativePath(java.lang.StringBuffer)

appendRelativePathOnVolume

public java.lang.StringBuffer appendRelativePathOnVolume(java.lang.StringBuffer buffer)
Description copied from interface: VEntry
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.

Specified by:
appendRelativePathOnVolume in interface VEntry
Parameters:
buffer - the string buffer to append the path to
Returns:
the specified StringBuffer with this entries path appended to it
See Also:
VEntry.appendRelativePathOnVolume(java.lang.StringBuffer)

appendURI

public java.lang.StringBuffer appendURI(java.lang.StringBuffer buffer)
Description copied from interface: VEntry
Appends the URI of this entry to the specified string buffer.

Specified by:
appendURI in interface VEntry
Parameters:
buffer - the string buffer to append the URI to
Returns:
the specified StringBuffer with this entries URI appended to it
See Also:
VEntry.appendURI(java.lang.StringBuffer)

exists

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

Specified by:
exists in interface VEntry
Returns:
true if this entry exits and false otherwise
See Also:
VEntry.exists()

getAbsolutePath

public java.lang.String getAbsolutePath()
Description copied from interface: VEntry
Returns the absolute path to this entry.

Specified by:
getAbsolutePath in interface VEntry
Returns:
the absolute path string for this entry
See Also:
VEntry.getAbsolutePath()

getAbsolutePathOnVolume

public java.lang.String getAbsolutePathOnVolume()
Description copied from interface: VEntry
Returns the absolute path to this entry, on this entries volume.

Specified by:
getAbsolutePathOnVolume in interface VEntry
Returns:
the absolute path string for this entry
See Also:
VEntry.getAbsolutePathOnVolume()

getAppendOutputStream

public java.io.OutputStream getAppendOutputStream()
Description copied from interface: VFile
Returns an output stream for appending to the existing file contents.

Specified by:
getAppendOutputStream in interface VFile
Returns:
an OutputStream ready to append to the file contents
See Also:
VFile.getAppendOutputStream()

getAppendWriter

public java.io.Writer getAppendWriter()
Description copied from interface: VFile
Returns a writer for appending to the existing file contents.

Specified by:
getAppendWriter in interface VFile
Returns:
a Writer ready to append to the file contents
See Also:
VFile.getAppendWriter()

getContentMIMEType

public java.lang.String getContentMIMEType()
Description copied from interface: VFile
Returns the MIME type for the contents of this file.

Specified by:
getContentMIMEType in interface VFile
Returns:
a String holding the MIME type for the contents of this file
See Also:
VFile.getContentMIMEType()

getInputStream

public java.io.InputStream getInputStream()
Description copied from interface: VFile
Returns an input stream for reading the file contents.

Specified by:
getInputStream in interface VFile
Returns:
an InputStream ready to read the file contents
See Also:
VFile.getInputStream()

getMIMEType

public java.lang.String getMIMEType(java.lang.String fileName)
Description copied from interface: VEntry
Returns the MIME type for the specified file name.

Specified by:
getMIMEType in interface VEntry
Parameters:
fileName - the file name to get a MIME type for
Returns:
a String holding the MIME type for the specified file name
See Also:
VEntry.getMIMEType(java.lang.String)

getMIMETypeHandler

public MIMETypeHandler getMIMETypeHandler(java.lang.String type)
Description copied from interface: VEntry
Returns a MIME type handler for the specified type.

Specified by:
getMIMETypeHandler in interface VEntry
Parameters:
type - the MIME type to get a handler for
Returns:
a MIMETypeHandler for the specified type
See Also:
VEntry.getMIMETypeHandler(java.lang.String)

getName

public java.lang.String getName()
Description copied from interface: VEntry
Returns the name of this entry in the filesystem.

Specified by:
getName in interface VEntry
Returns:
this entries name
See Also:
VEntry.getName()

getOutputStream

public java.io.OutputStream getOutputStream()
Description copied from interface: VFile
Returns an ouptut stream for writing the file contents.

Specified by:
getOutputStream in interface VFile
Returns:
an OutputStream ready to write the file contents
See Also:
VFile.getOutputStream()

getParent

public VFolder getParent()
Description copied from interface: VEntry
Returns the parent folder for this entry.

Specified by:
getParent in interface VEntry
Returns:
the parent folder for this entry
See Also:
VEntry.getParent()

getReader

public java.io.Reader getReader()
Description copied from interface: VFile
Returns a reader for reading the file contents.

Specified by:
getReader in interface VFile
Returns:
a Reader ready to read the file contents
See Also:
VFile.getReader()

getRelativePath

public java.lang.String getRelativePath()
Description copied from interface: VEntry
Returns the relative path to this entry.

Specified by:
getRelativePath in interface VEntry
Returns:
the relative path string for this entry
See Also:
VEntry.getRelativePath()

getRelativePathOnVolume

public java.lang.String getRelativePathOnVolume()
Description copied from interface: VEntry
Returns the relative path to this entry, on this entries volume.

Specified by:
getRelativePathOnVolume in interface VEntry
Returns:
the relative path string for this entry
See Also:
VEntry.getRelativePathOnVolume()

getURI

public java.net.URI getURI()
Description copied from interface: VEntry
Returns the URI for this virtual filesystem entry.

Specified by:
getURI in interface VEntry
Returns:
a URI for this entry
See Also:
VEntry.getURI()

getVolume

public VVolume getVolume()
Description copied from interface: VEntry
Returns the volume this entry is located on.

Specified by:
getVolume in interface VEntry
Returns:
the VVolume for this entry
See Also:
VEntry.getVolume()

getWriter

public java.io.Writer getWriter()
Description copied from interface: VFile
Returns a writer for writing the file contents.

Specified by:
getWriter in interface VFile
Returns:
a Writer ready to wrote the file contents
See Also:
VFile.getWriter()

toLocal

public VFile toLocal()
Description copied from interface: VEntry
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.

Specified by:
toLocal in interface VEntry
Specified by:
toLocal in interface VFile
Returns:
a VEntry for a local copy of this entry
See Also:
VEntry.toLocal()


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