Class ProjectFileStorage


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

      • DEFAULT_FOLDER_MARKER

        public static final java.lang.String DEFAULT_FOLDER_MARKER
        A marker that tells OmegaT that project's subfolder has default location.
        See Also:
        Constant Field Values
    • Method Detail

      • parseProjectFile

        public static Omegat parseProjectFile​(java.io.File file)
                                       throws java.lang.Exception
        Throws:
        java.lang.Exception
      • parseProjectFile

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

        public static ProjectProperties loadProjectProperties​(java.io.File projectDir)
                                                       throws java.lang.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:
        java.lang.Exception
      • loadPropertiesFile

        public static ProjectProperties loadPropertiesFile​(java.io.File projectDir,
                                                           java.io.File projectFile)
                                                    throws java.lang.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:
        java.lang.Exception
      • writeProjectFile

        public static void writeProjectFile​(ProjectProperties props)
                                     throws java.lang.Exception
        Saves project file to disk.
        Throws:
        java.lang.Exception