org.millscript.commons.vfs
Class AbstractVFile<V extends VVolume>

java.lang.Object
  extended by org.millscript.commons.vfs.AbstractVEntry<V>
      extended by org.millscript.commons.vfs.AbstractVFile<V>
All Implemented Interfaces:
org.millscript.commons.alert.AlertDecorator, VEntry, VFile
Direct Known Subclasses:
FtpFile, HttpFile, LocalFile, ReadOnlyZipFile

public abstract class AbstractVFile<V extends VVolume>
extends AbstractVEntry<V>
implements org.millscript.commons.alert.AlertDecorator, VFile

This class provides the skeletal implementation of a virtual filesystem file,


Constructor Summary
AbstractVFile(V vol, VFolder parent, java.lang.String name)
          Constructs a new virtual filesystem file with the specified name, parent folder and volume.
 
Method Summary
 java.lang.StringBuffer appendRelativePath(java.lang.StringBuffer buff)
          Appends the relative path to this entry to the specified string buffer.
 java.lang.StringBuffer appendRelativePathOnVolume(java.lang.StringBuffer buff)
          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.
 org.millscript.commons.alert.Alert decorate(org.millscript.commons.alert.Alert alert)
           
 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.Reader getReader()
          Returns a reader for reading the file contents.
 java.io.Writer getWriter()
          Returns a writer for writing the file contents.
 LocalFile toLocal()
          Returns this virtual entry as a local entry, which may simply be this object.
 java.lang.String toString()
           
 
Methods inherited from class org.millscript.commons.vfs.AbstractVEntry
appendAbsolutePath, appendAbsolutePathOnVolume, getAbsolutePath, getAbsolutePathOnVolume, getMIMEType, getMIMETypeHandler, getName, getParent, getRelativePath, getRelativePathOnVolume, getURI, getVolume
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface org.millscript.commons.vfs.VFile
getAppendOutputStream, getInputStream, getOutputStream
 
Methods inherited from interface org.millscript.commons.vfs.VEntry
appendAbsolutePath, appendAbsolutePathOnVolume, exists, getAbsolutePath, getAbsolutePathOnVolume, getMIMEType, getMIMETypeHandler, getName, getParent, getRelativePath, getRelativePathOnVolume, getURI, getVolume
 

Constructor Detail

AbstractVFile

public AbstractVFile(V vol,
                     VFolder parent,
                     java.lang.String name)
Constructs a new virtual filesystem file with the specified name, parent folder and volume.

Parameters:
vol - the volume this entry is held on
parent - the parent folder for this file
name - the name of the file
Method Detail

appendRelativePath

public final java.lang.StringBuffer appendRelativePath(java.lang.StringBuffer buff)
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:
buff - 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 buff)
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:
buff - 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 final 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)

decorate

public org.millscript.commons.alert.Alert decorate(org.millscript.commons.alert.Alert alert)
Specified by:
decorate in interface org.millscript.commons.alert.AlertDecorator
See Also:
AlertDecorator.decorate(org.millscript.commons.alert.Alert)

getAppendWriter

public final 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()

getReader

public final 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()

getWriter

public final 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 LocalFile 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:
VFile.toLocal()

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object
See Also:
Object.toString()


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