public class WorkspaceSerializer
extends java.lang.Object
Constructor and Description |
---|
WorkspaceSerializer(Workspace workspace)
Creates a new serializer.
|
Modifier and Type | Method and Description |
---|---|
void |
deserialize(java.io.InputStream stream)
Deserializes all the entries in the provided stream.
|
void |
deserialize(java.io.InputStream stream,
java.util.Collection<? extends java.lang.String> exclude)
Creates a workspace from a zip compressed input stream.
|
static WorkspaceComponent |
open(java.lang.Class<?> fileClass,
java.io.File file)
Helper method for openings workspace components from a file.
|
static void |
save(java.io.File file,
Workspace workspace)
Helper method to save a specified file.
|
void |
serialize(java.io.OutputStream output)
Serializes the workspace to a zip compressed stream.
|
public WorkspaceSerializer(Workspace workspace)
workspace
- The workspace to serialize to or from.public void serialize(java.io.OutputStream output) throws java.io.IOException
output
- The output stream to write to.java.io.IOException
- If there is an IO error.public void deserialize(java.io.InputStream stream) throws java.io.IOException
stream
- The input stream.java.io.IOException
- If an IO error occurs.public void deserialize(java.io.InputStream stream, java.util.Collection<? extends java.lang.String> exclude) throws java.io.IOException
stream
- The stream to read from. This is expected to be zip
compressed.exclude
- The list of uris to ignore on import.java.io.IOException
- if an IO error occurs.public static WorkspaceComponent open(java.lang.Class<?> fileClass, java.io.File file)
NetworkComponent networkComponent =
(NetworkComponent) WorkspaceFileOpener(NetworkComponent.class, new File("Net.xml"));
fileClass
- the type of Workpsace component to open; a subclass of
WorkspaceComponent.file
- the File to openpublic static void save(java.io.File file, Workspace workspace)
file
- file to save.workspace
- reference to workspace