Class FileDataTypeManager

All Implemented Interfaces:
DataTypeManager, FileArchiveBasedDataTypeManager, FileBasedDataTypeManager

public class FileDataTypeManager extends StandAloneDataTypeManager implements FileArchiveBasedDataTypeManager
DataTypeManager for a file. Can import categories from a file, or export categories to a packed database.
  • Field Details

  • Method Details

    • createFileArchive

      public static FileDataTypeManager createFileArchive(File packedDbfile) throws IOException
      Create a new data-type file archive using the default data organization
      Parameters:
      packedDbfile - archive file (filename must end with DataTypeFileManager.SUFFIX)
      Returns:
      data-type manager backed by specified packedDbFile
      Throws:
      IOException
    • openFileArchive

      public static FileDataTypeManager openFileArchive(File packedDbfile, boolean openForUpdate) throws IOException
      Open an existing data-type file archive using the default data organization
      Parameters:
      packedDbfile - archive file (filename must end with DataTypeFileManager.SUFFIX)
      openForUpdate - if true archive will be open for update
      Returns:
      data-type manager backed by specified packedDbFile
      Throws:
      IOException
    • openFileArchive

      public static FileDataTypeManager openFileArchive(ResourceFile packedDbfile, boolean openForUpdate) throws IOException
      Open an existing data-type file archive using the default data organization
      Parameters:
      packedDbfile - archive file (filename must end with DataTypeFileManager.SUFFIX)
      openForUpdate - if true archive will be open for update
      Returns:
      data-type manager backed by specified packedDbFile
      Throws:
      IOException
    • saveAs

      public void saveAs(File saveFile, UniversalID newUniversalId) throws DuplicateFileException, IOException
      Saves the data type manager to the given file with a specific databaseId. NOTE: This method is intended for use in transforming one archive database to match another existing archive database.
      Parameters:
      saveFile - the file to save
      newUniversalId - the new id to use
      Throws:
      DuplicateFileException
      IOException
    • saveAs

      public void saveAs(File saveFile) throws DuplicateFileException, IOException
      Saves the data type manager to the given file
      Parameters:
      saveFile - the file to save
      Throws:
      DuplicateFileException
      IOException
    • save

      public void save() throws IOException
      Save the category to source file.
      Throws:
      IOException
    • getFilename

      public String getFilename()
      Get the filename for the current file.
      Returns:
      String filename, or null if there is no current file.
    • convertFilename

      public static File convertFilename(File file)
      Convert the filename for the given file to have the packed database file extension.
      Parameters:
      file - file whose name is to be converted
      Returns:
      file if the filename already ends in the packed database file extension, or a new File object that has the packed database file extension
    • delete

      public void delete() throws IOException
      Throws:
      IOException
    • close

      public void close()
      Description copied from interface: DataTypeManager
      Closes this dataType manager
      Specified by:
      close in interface DataTypeManager
      Overrides:
      close in class StandAloneDataTypeManager
    • isClosed

      public boolean isClosed()
    • finalize

      public void finalize()
      Overrides:
      finalize in class StandAloneDataTypeManager
    • delete

      public static void delete(File packedDbfile) throws IOException
      Throws:
      IOException
    • getPath

      public String getPath()
      Specified by:
      getPath in interface FileBasedDataTypeManager
      Overrides:
      getPath in class StandAloneDataTypeManager
    • getType

      public ArchiveType getType()
      Description copied from interface: DataTypeManager
      Returns this manager's archive type
      Specified by:
      getType in interface DataTypeManager
      Overrides:
      getType in class StandAloneDataTypeManager
      Returns:
      the type
    • toString

      public String toString()
      Overrides:
      toString in class Object