Package org.omegat.util
Class ProjectFileStorage
- java.lang.Object
-
- org.omegat.util.ProjectFileStorage
-
public final class ProjectFileStorage extends java.lang.Object
Class that reads and saves project definition file.
-
-
Field Summary
Fields Modifier and Type Field Description static java.lang.String
DEFAULT_FOLDER_MARKER
A marker that tells OmegaT that project's subfolder has default location.
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static ProjectProperties
loadProjectProperties(java.io.File projectDir)
Load the project properties file for the project at the specified directory.static ProjectProperties
loadPropertiesFile(java.io.File projectDir, java.io.File projectFile)
Load the specified project properties file for the project at the specified directory.static Omegat
parseProjectFile(byte[] projectFile)
static Omegat
parseProjectFile(java.io.File file)
static void
writeProjectFile(ProjectProperties props)
Saves project file to disk.
-
-
-
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 forloadPropertiesFile(File, File)
.If the supplied
File
is not a directory, anIllegalArgumentException
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 orprojectFile
is not a file, anIllegalArgumentException
will be thrown.- Parameters:
projectDir
- The directory of the projectprojectFile
- 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
-
-