Constructor and Description |
---|
FileRepresentation(String filename)
Creates a new
FileParameter.FileRepresentation from a filename. |
FileRepresentation(StringBuffer buf)
The standard constructor for the interface
Storable
. |
FileRepresentation(String filename,
String content)
Creates a
FileParameter.FileRepresentation out of the filename and the
file's contents. |
Modifier and Type | Method and Description |
---|---|
FileParameter.FileRepresentation |
clone() |
String |
getContent()
Returns the content of the file.
|
String |
getExtension()
Returns the extension of this
FileParameter . |
String |
getFilename()
Returns the filename.
|
long |
getFilesize()
Returns the size of the file of the
FileParameter.FileRepresentation
as specified in the constructor. |
void |
setExtension(String ext)
Sets the extension of this
FileParameter . |
void |
setFilename(String filename)
Sets the file name of this
FileParameter |
StringBuffer |
toXML()
This method returns an XML representation as
StringBuffer of an
instance of the implementing class. |
public FileRepresentation(String filename, String content)
FileParameter.FileRepresentation
out of the filename and the
file's contents.filename
- the name of the filecontent
- the contents of the filepublic FileRepresentation(String filename)
FileParameter.FileRepresentation
from a filename.filename
- the filenamepublic FileRepresentation(StringBuffer buf) throws NonParsableException
Storable
. Restores the FileParameter.FileRepresentation
from an XML representation.buf
- the XML representation as StringBuffer
NonParsableException
- if the StringBuffer
could not be parsedpublic FileParameter.FileRepresentation clone() throws CloneNotSupportedException
clone
in class Object
CloneNotSupportedException
public String getFilename()
public void setFilename(String filename)
FileParameter
filename
- the new file namepublic long getFilesize()
FileParameter.FileRepresentation
as specified in the constructor. If filename
is null
in
the constructor, -1 is returned.File.length()
public String getContent()
public void setExtension(String ext)
FileParameter
.ext
- the extensionpublic String getExtension()
FileParameter
.public StringBuffer toXML()
Storable
StringBuffer
of an
instance of the implementing class.