Class ProjectProperties.ProjectPath

  • Enclosing class:
    ProjectProperties

    public final class ProjectProperties.ProjectPath
    extends java.lang.Object
    Class for support project path functionality, like relative path, etc.
    • Constructor Summary

      Constructors 
      Constructor Description
      ProjectPath​(boolean isDirectory)  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      java.io.File getAsFile()  
      java.lang.String getAsString()  
      java.lang.String getUnderRoot()
      Returns path relative to project root with '/' at the end for directories, or null if directory outside of project.
      boolean isUnderRoot()  
      void setRelativeOrAbsolute​(java.lang.String path)
      path is directory(or file) as declared in the omegat.project, but not __DEFAULT__.
      • Methods inherited from class java.lang.Object

        equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • ProjectPath

        public ProjectPath​(boolean isDirectory)
        Parameters:
        isDirectory - true if directory(i.e. should be ended by '/'), false if file
    • Method Detail

      • setRelativeOrAbsolute

        public void setRelativeOrAbsolute​(java.lang.String path)
        path is directory(or file) as declared in the omegat.project, but not __DEFAULT__. I.e. caller can send something like "/some/project/source", or "source", or "source/". Absolute paths from Windows will be treated as relative on Linux/MacOS, and vice versa.
      • getAsFile

        public java.io.File getAsFile()
      • getAsString

        public java.lang.String getAsString()
      • isUnderRoot

        public boolean isUnderRoot()
      • getUnderRoot

        public java.lang.String getUnderRoot()
        Returns path relative to project root with '/' at the end for directories, or null if directory outside of project.