Class ProjectProperties

java.lang.Object
org.omegat.core.data.ProjectProperties

public class ProjectProperties extends Object
Storage for project properties. May read and write project from/to disk.
  • Constructor Details

    • ProjectProperties

      public ProjectProperties(File projectDir)
      Default constructor to initialize fields (to get no NPEs). Real values should be applied after creation.
  • Method Details

    • getDefaultExcludes

      public static List<String> getDefaultExcludes()
    • getTargetRoot

      public String getTargetRoot()
      Returns The Target (Compiled) Files Directory
    • setTargetRoot

      public void setTargetRoot(String targetRoot)
      Sets The Target (Compiled) Files Directory
    • getTargetDir

      public ProjectProperties.ProjectPath getTargetDir()
    • getGlossaryRoot

      public String getGlossaryRoot()
      Returns The Glossary Files Directory
    • setGlossaryRoot

      public void setGlossaryRoot(String glossaryRoot)
      Sets The Glossary Files Directory
    • getGlossaryDir

      public ProjectProperties.ProjectPath getGlossaryDir()
    • getWritableGlossaryFile

      public ProjectProperties.ProjectPath getWritableGlossaryFile()
    • getWriteableGlossary

      public String getWriteableGlossary()
      Returns The Glossary File Location
    • getWriteableGlossaryDir

      public String getWriteableGlossaryDir()
      Returns The Glossary File Directory
    • setWriteableGlossary

      public void setWriteableGlossary(String writeableGlossaryFile)
      Sets The Writeable Glossary File Location
    • isDefaultWriteableGlossaryFile

      public boolean isDefaultWriteableGlossaryFile()
    • computeDefaultWriteableGlossaryFile

      public String computeDefaultWriteableGlossaryFile()
    • getTmDir

      public ProjectProperties.ProjectPath getTmDir()
    • getTMRoot

      public String getTMRoot()
      Returns The Translation Memory (TMX) Files Directory
    • getExportTMRoot

      public String getExportTMRoot()
      Returns The Translation Memory (TMX) Files Directory
    • setTMRoot

      public void setTMRoot(String tmRoot)
      Sets The Translation Memory (TMX) Files Directory
    • setExportTMRoot

      public void setExportTMRoot(String exportTMRoot)
      Sets The Export Translation Memory (TMX) Files Directory
    • getTMOtherLangRoot

      public String getTMOtherLangRoot()
      Returns The Translation Memory (TMX) with translations to other languages Files Directory
    • getTMAutoRoot

      public String getTMAutoRoot()
      Returns The Translation Memory (TMX) Files Directory for automatically applied files.
    • getTMEnforceRoot

      public String getTMEnforceRoot()
      Returns The Translation Memory (TMX) Files Directory for automatically enforced files.
    • getTMMTRoot

      public String getTMMTRoot()
      Returns The Translation Memory (TMX) Files Directory for machine translation files.
    • getTMPenaltyRoot

      public String getTMPenaltyRoot()
      Returns The Translation Memory (TMX) Files Directory for files with penalties.
    • getDictDir

      public ProjectProperties.ProjectPath getDictDir()
    • getDictRoot

      public String getDictRoot()
      Returns The Dictionaries Files Directory
    • setDictRoot

      public void setDictRoot(String dictRoot)
      Sets Dictionaries Files Directory
    • getDictRootRelative

      public String getDictRootRelative()
    • getProjectName

      public String getProjectName()
      Returns the name of the Project
    • getProjectRoot

      public String getProjectRoot()
      Returns The Project Root Directory
    • getProjectRootDir

      public File getProjectRootDir()
    • getProjectInternal

      public String getProjectInternal()
      Returns The Project's Translation Memory (TMX) File
    • getProjectInternalDir

      public File getProjectInternalDir()
    • getProjectInternalRelative

      public String getProjectInternalRelative()
    • getSourceRoot

      public String getSourceRoot()
      Returns The Source (to be translated) Files Directory
    • setSourceRoot

      public void setSourceRoot(String sourceRoot)
      Sets The Source (to be translated) Files Directory
    • setSourceRootRelative

      public void setSourceRootRelative(String sourceRootRelative)
    • getSourceDir

      public ProjectProperties.ProjectPath getSourceDir()
    • getSourceRootExcludes

      public List<String> getSourceRootExcludes()
    • getSourceLanguage

      public Language getSourceLanguage()
      Returns The Source Language (language of the source files) of the Project
    • setSourceLanguage

      public void setSourceLanguage(Language sourceLanguage)
      Sets The Source Language (language of the source files) of the Project
    • setSourceLanguage

      public void setSourceLanguage(String sourceLanguage)
      Sets The Source Language (language of the source files) of the Project
    • getTargetLanguage

      public Language getTargetLanguage()
      Returns The Target Language (language of the translated files) of the Project
    • setTargetLanguage

      public void setTargetLanguage(Language targetLanguage)
      Sets The Target Language (language of the translated files) of the Project
    • setTargetLanguage

      public void setTargetLanguage(String targetLanguage)
      Sets The Target Language (language of the translated files) of the Project
    • getSourceTokenizer

      public Class<?> getSourceTokenizer()
      Returns the class name of the source language tokenizer for the Project.
    • setSourceTokenizer

      public void setSourceTokenizer(Class<?> sourceTokenizer)
      Sets the class name of the source language tokenizer for the Project.
    • getTargetTokenizer

      public Class<?> getTargetTokenizer()
      Returns the class name of the target language tokenizer for the Project.
    • setTargetTokenizer

      public void setTargetTokenizer(Class<?> targetTokenizer)
      Sets the class name of the target language tokenizer for the Project.
    • isSentenceSegmentingEnabled

      public boolean isSentenceSegmentingEnabled()
      Returns whether The Sentence Segmenting is Enabled for this Project. Default, Yes.
    • setSentenceSegmentingEnabled

      public void setSentenceSegmentingEnabled(boolean sentenceSegmentingEnabled)
      Sets whether The Sentence Segmenting is Enabled for this Project
    • setExportTmLevels

      public void setExportTmLevels(boolean omT, boolean level1, boolean level2)
      Sets level(s) of TMs to be exported by project. Accepts three booleans as arguments, corresponding to OmegaT, Level 1 and Level 2
    • setExportTmLevels

      public void setExportTmLevels(List<String> levels)
      Sets level(s) of TMs to be exported by project. Accepts list of levels
    • getExportTmLevels

      public List<String> getExportTmLevels()
    • isExportTm

      public boolean isExportTm(String level)
      Returns whether a given TM level will be exported
    • isSupportDefaultTranslations

      public boolean isSupportDefaultTranslations()
    • setSupportDefaultTranslations

      public void setSupportDefaultTranslations(boolean supportDefaultTranslations)
    • isRemoveTags

      public boolean isRemoveTags()
    • setRemoveTags

      public void setRemoveTags(boolean removeTags)
    • hasRepositories

      public boolean hasRepositories()
    • getRepositories

      public List<RepositoryDefinition> getRepositories()
    • isTeamProject

      public boolean isTeamProject()
      Determines if the project is a team project. A project is considered a team project if it has repositories defined, and at least one repository mapping has either a local path set to an empty string or a single forward slash to specify OmegaT project root.
      Returns:
      true if the project is a team project, false otherwise
    • setRepositories

      public void setRepositories(List<RepositoryDefinition> repositories)
    • getProjectSRX

      public SRX getProjectSRX()
    • setProjectSRX

      public void setProjectSRX(SRX projectSRX)
    • loadProjectSRX

      public void loadProjectSRX()
      Loads segmentation.conf if found in the /omegat folder of the project.
    • getProjectFilters

      public Filters getProjectFilters()
    • setProjectFilters

      public void setProjectFilters(Filters projectFilters)
    • loadProjectFilters

      public void loadProjectFilters() throws IOException
      Loads filters.xml if found in the /omegat filter of the project
      Throws:
      IOException - if filters.xml is not found or corrupted.
    • loadProjectFiltersOrDefaults

      public void loadProjectFiltersOrDefaults()
      Loads the project-specific filters or falls back to default filters if the project filters cannot be loaded due to an exception.

      Attempts to load the filters defined in the project's configuration by invoking the loadProjectFilters() method. If the method throws an IOException, the projectFilters field is initialized with default filter settings using a new Filters instance.

    • getExternalCommand

      public String getExternalCommand()
    • setExternalCommand

      public void setExternalCommand(String command)
    • isProjectValid

      public boolean isProjectValid()
    • verifyProject

      public void verifyProject() throws ProjectException
      Verify project and print any problems.
      Throws:
      ProjectException
    • autocreateDirectories

      public void autocreateDirectories()