Class V01Transcoder
java.lang.Object
com.illumon.iris.gui.workspace.compatability.V01Transcoder
- All Implemented Interfaces:
WorkspaceTranscoder
public class V01Transcoder extends Object implements WorkspaceTranscoder
-
Constructor Summary
Constructors Constructor Description V01Transcoder(com.fishlib.io.logger.Logger log)
A transcoder that can convert Workspaces that consisted of (view.dat, workspace.dat, tables.dat) into a single XML file containing everything in a structured format tying workspaces to the views that own them.' -
Method Summary
Modifier and Type Method Description SavedWorkspace
convertWorkspace(SavedWorkspace workspace, Path destination, boolean isStandalone)
Convert the specified workspace toWorkspaceTranscoder.getToVersion()
.int
getFromVersion()
SavedWorkspace
getMostRecentWorkspace(String pathStr)
Get the most recent workspace this transcoder understands at the specified path.int
getToVersion()
Collection<SavedWorkspace>
getWorkspaces(String path, WorkspaceManager.SaveType saveType)
Get all of the workspaces this transcoder understands at the specified path.SavedWorkspace
tryGetSavedWorkspace(Path path)
Try to create a SavedWorkspace at this transcoder version from the specified path.
-
Constructor Details
-
V01Transcoder
public V01Transcoder(@NotNull com.fishlib.io.logger.Logger log)A transcoder that can convert Workspaces that consisted of (view.dat, workspace.dat, tables.dat) into a single XML file containing everything in a structured format tying workspaces to the views that own them.'- Parameters:
log
- A logger to use to report status and problems.
-
-
Method Details
-
getFromVersion
public int getFromVersion()- Specified by:
getFromVersion
in interfaceWorkspaceTranscoder
- Returns:
- The workspace version this transcoder converts from.
-
getToVersion
public int getToVersion()- Specified by:
getToVersion
in interfaceWorkspaceTranscoder
- Returns:
- The workspace version this transcoder converts to.
-
convertWorkspace
public SavedWorkspace convertWorkspace(SavedWorkspace workspace, Path destination, boolean isStandalone) throws TranscodingExceptionDescription copied from interface:WorkspaceTranscoder
Convert the specified workspace toWorkspaceTranscoder.getToVersion()
.- Specified by:
convertWorkspace
in interfaceWorkspaceTranscoder
- Parameters:
workspace
- The workspace to convert. Must be atWorkspaceTranscoder.getFromVersion()
destination
- The path for writing out the new file, this may be adjusted by the transcoder as necessaryisStandalone
- if the console is in standalone mode- Returns:
- A new
SavedWorkspace
at versionWorkspaceTranscoder.getToVersion()
- Throws:
TranscodingException
- If there was an error during conversion
-
tryGetSavedWorkspace
Description copied from interface:WorkspaceTranscoder
Try to create a SavedWorkspace at this transcoder version from the specified path.- Specified by:
tryGetSavedWorkspace
in interfaceWorkspaceTranscoder
- Parameters:
path
- The path to the workspace to try to parse- Returns:
- A SavedWorkspace or null if the workspace couldn't be parsed.
-
getWorkspaces
Description copied from interface:WorkspaceTranscoder
Get all of the workspaces this transcoder understands at the specified path.- Specified by:
getWorkspaces
in interfaceWorkspaceTranscoder
- Parameters:
path
- The path to search in.saveType
- The type of workspace save to get- Returns:
- All of the workspaces this transcoder understands.
-
getMostRecentWorkspace
Description copied from interface:WorkspaceTranscoder
Get the most recent workspace this transcoder understands at the specified path.- Specified by:
getMostRecentWorkspace
in interfaceWorkspaceTranscoder
- Parameters:
pathStr
- The path to search in- Returns:
- The most recent workspace this transcoder understands or null if there are none.
-