de.jstacs.parameters
Class FileParameter.FileRepresentation

java.lang.Object
  extended by de.jstacs.parameters.FileParameter.FileRepresentation
All Implemented Interfaces:
Storable, Cloneable
Enclosing class:
FileParameter

public static class FileParameter.FileRepresentation
extends Object
implements Storable, Cloneable

Class that represents a file.

Author:
Jan Grau

Constructor Summary
FileParameter.FileRepresentation(String filename)
          Creates a new FileParameter.FileRepresentation from a filename.
FileParameter.FileRepresentation(StringBuffer buf)
          The standard constructor for the interface Storable .
FileParameter.FileRepresentation(String filename, String content)
          Creates a FileParameter.FileRepresentation out of the filename and the file's contents.
 
Method Summary
 FileParameter.FileRepresentation clone()
           
 String getContent()
          Returns the content of the file.
 String getExtension()
          Returns the extension of this FileParameter.
 String getFilename()
          Returns the filename.
 void setExtension(String ext)
          Sets the extension of this FileParameter.
 StringBuffer toXML()
          This method returns an XML representation as StringBuffer of an instance of the implementing class.
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

FileParameter.FileRepresentation

public FileParameter.FileRepresentation(String filename,
                                        String content)
Creates a FileParameter.FileRepresentation out of the filename and the file's contents.

Parameters:
filename - the name of the file
content - the contents of the file

FileParameter.FileRepresentation

public FileParameter.FileRepresentation(String filename)
Creates a new FileParameter.FileRepresentation from a filename.

Parameters:
filename - the filename

FileParameter.FileRepresentation

public FileParameter.FileRepresentation(StringBuffer buf)
                                 throws NonParsableException
The standard constructor for the interface Storable . Restores the FileParameter.FileRepresentation from an XML representation.

Parameters:
buf - the XML representation as StringBuffer
Throws:
NonParsableException - if the StringBuffer could not be parsed
Method Detail

clone

public FileParameter.FileRepresentation clone()
                                       throws CloneNotSupportedException
Overrides:
clone in class Object
Throws:
CloneNotSupportedException

getFilename

public String getFilename()
Returns the filename.

Returns:
the name of the file

getContent

public String getContent()
Returns the content of the file.

Returns:
the content of the file

setExtension

public void setExtension(String ext)
Sets the extension of this FileParameter.

Parameters:
ext - the extension

getExtension

public String getExtension()
Returns the extension of this FileParameter.

Returns:
the extension

toXML

public StringBuffer toXML()
Description copied from interface: Storable
This method returns an XML representation as StringBuffer of an instance of the implementing class.

Specified by:
toXML in interface Storable
Returns:
the XML representation