Class V56Transcoder

java.lang.Object
com.illumon.iris.gui.workspace.compatability.V56Transcoder
All Implemented Interfaces:
WorkspaceTranscoder

public class V56Transcoder extends Object
In the V6 workspace we removed serialized ImageIcons from the workspace for Java 11 support. This transcoder finds all of the ImageIcon properties and removes them from the xml.
  • Field Details

    • log

      protected final com.fishlib.io.logger.Logger log
  • Constructor Details

    • V56Transcoder

      public V56Transcoder(com.fishlib.io.logger.Logger log)
  • Method Details

    • getFromVersion

      public int getFromVersion()
      Returns:
      The workspace version this transcoder converts from.
    • getToVersion

      public int getToVersion()
      Returns:
      The workspace version this transcoder converts to.
    • getBackupDirectory

      protected Path getBackupDirectory()
    • convertWorkspace

      protected void convertWorkspace(org.jdom2.Element root, boolean isStandalone)
    • getMostRecentWorkspace

      @Nullable public SavedWorkspace getMostRecentWorkspace(String pathStr)
      Description copied from interface: WorkspaceTranscoder
      Get the most recent workspace this transcoder understands at the specified path.
      Specified by:
      getMostRecentWorkspace in interface WorkspaceTranscoder
      Parameters:
      pathStr - The path to search in
      Returns:
      The most recent workspace this transcoder understands or null if there are none.
    • getWorkspaces

      public Collection<SavedWorkspace> getWorkspaces(String pathStr, WorkspaceManager.SaveType saveType)
      Description copied from interface: WorkspaceTranscoder
      Get all of the workspaces this transcoder understands at the specified path.
      Specified by:
      getWorkspaces in interface WorkspaceTranscoder
      Parameters:
      pathStr - The path to search in.
      saveType - The type of workspace save to get
      Returns:
      All of the workspaces this transcoder understands.
    • backupFiles

      protected void backupFiles(WorkspaceManager.Context context) throws IOException
      Backs up the workspace under conversion into a folder v3backups in the workspace path in case something goes wrong during conversion.
      Parameters:
      context - The context containing the details of the workpsace under conversion.
      Throws:
      IOException - If anything goes wrong with the backup.
    • convertWorkspace

      public SavedWorkspace convertWorkspace(SavedWorkspace workspace, Path destination, boolean isStandalone) throws TranscodingException
      Description copied from interface: WorkspaceTranscoder
      Convert the specified workspace to WorkspaceTranscoder.getToVersion().
      Specified by:
      convertWorkspace in interface WorkspaceTranscoder
      Parameters:
      workspace - The workspace to convert. Must be at WorkspaceTranscoder.getFromVersion()
      destination - The path for writing out the new file, this may be adjusted by the transcoder as necessary
      isStandalone - if the console is in standalone mode
      Returns:
      A new SavedWorkspace at version WorkspaceTranscoder.getToVersion()
      Throws:
      TranscodingException - If there was an error during conversion
    • tryGetSavedWorkspace

      public SavedWorkspace tryGetSavedWorkspace(Path path)
      Description copied from interface: WorkspaceTranscoder
      Try to create a SavedWorkspace at this transcoder version from the specified path.
      Specified by:
      tryGetSavedWorkspace in interface WorkspaceTranscoder
      Parameters:
      path - The path to the workspace to try to parse
      Returns:
      A SavedWorkspace or null if the workspace couldn't be parsed.