org.millscript.commons.vfs.protocols.file
Class LocalFile

java.lang.Object
  extended by org.millscript.commons.vfs.AbstractVEntry<V>
      extended by org.millscript.commons.vfs.AbstractVFile<LocalVolume>
          extended by org.millscript.commons.vfs.protocols.file.LocalFile
All Implemented Interfaces:
org.millscript.commons.alert.AlertDecorator, VEntry, VFile

public class LocalFile
extends AbstractVFile<LocalVolume>

This class implements a virtual filesystem file for a local filesystem file.


Method Summary
 boolean exists()
          Tests to see if the entry exits.
 java.io.OutputStream getAppendOutputStream()
          Returns an output stream for appending to the existing file contents.
 java.io.File getFile()
          Returns the File for this local virtual file.
 java.io.InputStream getInputStream()
          Returns an input stream for reading the file contents.
 java.io.OutputStream getOutputStream()
          Returns an ouptut stream for writing the file contents.
 LocalFile toLocal()
          Returns this virtual entry as a local entry, which may simply be this object.
 
Methods inherited from class org.millscript.commons.vfs.AbstractVFile
appendRelativePath, appendRelativePathOnVolume, appendURI, decorate, getAppendWriter, getContentMIMEType, getReader, getWriter, 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.VEntry
appendAbsolutePath, appendAbsolutePathOnVolume, getAbsolutePath, getAbsolutePathOnVolume, getMIMEType, getMIMETypeHandler, getName, getParent, getRelativePath, getRelativePathOnVolume, getURI, getVolume
 

Method Detail

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.

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

getAppendOutputStream

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

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

getFile

public java.io.File getFile()
Returns the File for this local virtual file.

Returns:
a File for this local virtual file

getInputStream

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

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

getOutputStream

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

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

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
Overrides:
toLocal in class AbstractVFile<LocalVolume>
Returns:
a VEntry for a local copy of this entry
See Also:
AbstractVFile.toLocal()


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