Package org.omegat.util
Class ProjectFileStorage
- java.lang.Object
-
- org.omegat.util.ProjectFileStorage
-
public final class ProjectFileStorage extends java.lang.ObjectClass that reads and saves project definition file.
-
-
Field Summary
Fields Modifier and Type Field Description static java.lang.StringDEFAULT_FOLDER_MARKERA 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 ProjectPropertiesloadProjectProperties(java.io.File projectDir)Load the project properties file for the project at the specified directory.static ProjectPropertiesloadPropertiesFile(java.io.File projectDir, java.io.File projectFile)Load the specified project properties file for the project at the specified directory.static OmegatparseProjectFile(byte[] projectFile)static OmegatparseProjectFile(java.io.File file)static voidwriteProjectFile(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
Fileis not a directory, anIllegalArgumentExceptionwill 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
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:
java.lang.Exception
-
writeProjectFile
public static void writeProjectFile(ProjectProperties props) throws java.lang.Exception
Saves project file to disk.- Throws:
java.lang.Exception
-
-