Class ProjectFileStorage

java.lang.Object
org.omegat.util.ProjectFileStorage

public final class ProjectFileStorage extends Object
Class that reads and saves project definition file.
  • Field Details

    • DEFAULT_FOLDER_MARKER

      public static final String DEFAULT_FOLDER_MARKER
      A marker that tells OmegaT that project's subfolder has default location.
      See Also:
  • Method Details

    • parseProjectFile

      public static Omegat parseProjectFile(File file) throws Exception
      Throws:
      Exception
    • parseProjectFile

      public static Omegat parseProjectFile(byte[] projectFile) throws Exception
      Throws:
      Exception
    • loadProjectProperties

      public static ProjectProperties loadProjectProperties(File projectDir) throws Exception
      Load the project properties file for the project at the specified directory. The properties file is assumed to exist at the root of the project and have the default name, OConsts.FILE_PROJECT. This is a convenience method for loadPropertiesFile(File, File).

      If the supplied File is not a directory, an IllegalArgumentException will be thrown.

      Parameters:
      projectDir - The directory of the project
      Returns:
      The loaded project properties
      Throws:
      Exception
    • loadPropertiesFile

      public static ProjectProperties loadPropertiesFile(File projectDir, File projectFile) throws Exception
      Load the specified project properties file for the project at the specified directory.

      If projectDir is not a directory or projectFile is not a file, an IllegalArgumentException will be thrown.

      Parameters:
      projectDir - The directory of the project
      projectFile - The project properties file to load
      Returns:
      The loaded project properties
      Throws:
      Exception
    • writeProjectFile

      public static void writeProjectFile(ProjectProperties props) throws Exception
      Saves project file to disk to default `omegat.project` file.
      Throws:
      Exception
    • writeProjectFile

      public static void writeProjectFile(File outFile, ProjectProperties props) throws Exception
      Saves project file to disk.
      Throws:
      Exception