Package org.omegat.util
Class ProjectFileStorage
java.lang.Object
org.omegat.util.ProjectFileStorage
Class that reads and saves project definition file.
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final StringA marker that tells OmegaT that project's subfolder has default location. -
Method Summary
Modifier and TypeMethodDescriptionstatic ProjectPropertiesloadProjectProperties(File projectDir) Load the project properties file for the project at the specified directory.static ProjectPropertiesloadPropertiesFile(File projectDir, File projectFile) Load the specified project properties file for the project at the specified directory.static OmegatparseProjectFile(byte[] projectFile) static OmegatparseProjectFile(File file) static voidwriteProjectFile(File outFile, ProjectProperties props) Saves project file to disk.static voidSaves project file to disk to default `omegat.project` file.
-
Field Details
-
DEFAULT_FOLDER_MARKER
A marker that tells OmegaT that project's subfolder has default location.- See Also:
-
-
Method Details
-
parseProjectFile
- Throws:
Exception
-
parseProjectFile
- Throws:
Exception
-
loadProjectProperties
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
Fileis not a directory, anIllegalArgumentExceptionwill 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
projectDiris not a directory orprojectFileis not a file, anIllegalArgumentExceptionwill be thrown.- Parameters:
projectDir- The directory of the projectprojectFile- The project properties file to load- Returns:
- The loaded project properties
- Throws:
Exception
-
writeProjectFile
Saves project file to disk to default `omegat.project` file.- Throws:
Exception
-
writeProjectFile
Saves project file to disk.- Throws:
Exception
-