de.unido.ls5.eti.client
Class FileVirtualFile

java.lang.Object
  extended by de.unido.ls5.eti.client.FileVirtualFile
All Implemented Interfaces:
VirtualFile

public class FileVirtualFile
extends Object
implements VirtualFile

This is an implementation of VirtualFile that uses a real file object as means to store the data.

Rating red

Constructor Summary
FileVirtualFile(File file, String filename)
          Instanciate this VirtualFile with a given File and a virtual filename.
 
Method Summary
 String getFilename()
          Retrieves the virtual filename of this virtual file
 InputStream getInputStream()
          Provides the InputStream where the data of the represented file can be read from.
 String toString()
          Retrieve a debug output String for this virtual file containing the virtual filename and the absolute path of the underlying file object
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

FileVirtualFile

public FileVirtualFile(File file,
                       String filename)
                throws FileNotFoundException
Instanciate this VirtualFile with a given File and a virtual filename.

Parameters:
file - the given file
filename - the virtual filename
Throws:
FileNotFoundException - file does not exist
Method Detail

getFilename

public String getFilename()
Retrieves the virtual filename of this virtual file

Specified by:
getFilename in interface VirtualFile
Returns:
the virtual filename
See Also:
VirtualFile.getFilename()

getInputStream

public InputStream getInputStream()
                           throws IOException
Description copied from interface: VirtualFile
Provides the InputStream where the data of the represented file can be read from.

Specified by:
getInputStream in interface VirtualFile
Returns:
a FileInputStream to the underlying file object.
Throws:
IOException - may be thrown if the underlying implementation uses some I/O to read the data from.
See Also:
VirtualFile.getInputStream()

toString

public String toString()
Retrieve a debug output String for this virtual file containing the virtual filename and the absolute path of the underlying file object

Specified by:
toString in interface VirtualFile
Overrides:
toString in class Object
Returns:
the debug string of this virtual file