|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectsimtools.util.FileSerializer
public class FileSerializer
Serialize/deserialize a file description
write(ObjectOutputStream, File, File),
read(ObjectInputStream, File)| Field Summary | |
|---|---|
protected static java.io.File |
file
The current file the FileSerializer works on. |
protected static ListenerManager |
listeners
|
| Constructor Summary | |
|---|---|
FileSerializer()
|
|
| Method Summary | |
|---|---|
static void |
addListener(FileReferenceListener dsl)
|
static java.io.File |
getFile()
Get the current file the FileSerializer works on |
protected static void |
notifyFileReferenceListeners(java.io.File file)
|
java.io.File |
read(java.io.ObjectInputStream in,
java.io.File referenceFile)
Reads a file description from an input stream If the file computation fails an invalid file (not null) is returned |
static java.io.File |
readFromString(java.lang.String path,
java.io.File referenceFile)
Reads a file description from an input string If the file computation fails an invalid file (not null) is returned |
static void |
removeListener(FileReferenceListener dsl)
|
static void |
setFile(java.io.File file)
Get the current file the FileSerializer works on |
void |
write(java.io.ObjectOutputStream out,
java.io.File file,
java.io.File referenceFile)
Writes a file description to an output stream According to the file serializer configuration the following applies : - A computation of a relative path from the reference file to the file to serialize is performed. |
static java.lang.String |
writeIntoString(java.io.File file,
java.io.File referenceFile)
Writes a file description to an output string According to the file serializer configuration the following applies : A computation of a relative path from the reference file to the file to serialize is performed. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected static ListenerManager listeners
protected static java.io.File file
| Constructor Detail |
|---|
public FileSerializer()
| Method Detail |
|---|
public void write(java.io.ObjectOutputStream out,
java.io.File file,
java.io.File referenceFile)
throws java.io.IOException
out - the output streamfile - the file to savereferenceFile - the file to be used for relative path computation
java.io.IOException
public java.io.File read(java.io.ObjectInputStream in,
java.io.File referenceFile)
throws java.lang.ClassNotFoundException,
java.io.IOException
in - the stream to readreferenceFile - the file to be used for relative path computation
java.lang.ClassNotFoundException
java.io.IOException
public static java.lang.String writeIntoString(java.io.File file,
java.io.File referenceFile)
file - the file to savereferenceFile - the file to be used for relative path computation
public static java.io.File readFromString(java.lang.String path,
java.io.File referenceFile)
relative - or absolule path filereferenceFile - the file to be used for relative path computationpublic static void addListener(FileReferenceListener dsl)
public static void removeListener(FileReferenceListener dsl)
public static void setFile(java.io.File file)
file - public static java.io.File getFile()
protected static void notifyFileReferenceListeners(java.io.File file)
file - - The file that has been referenced
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||