Class CrowdinFileFactory

java.lang.Object
org.exoplatform.crowdin.model.CrowdinFileFactory

public class CrowdinFileFactory extends Object
  • Constructor Details

  • Method Details

    • prepareCrowdinFile

      public CrowdinFile prepareCrowdinFile(String _path, String _name, String _project)
      Creates and returns a CrowdinFile (master).
      Parameters:
      _path - the real path of the file on the system
      _name - the name with the Crowdin path
      _project - the project in Crowdin
      Returns:
      the CrowdinFile object that represents this file.
    • isTranslation

      public boolean isTranslation(String _filename)
      Checks whether a file is a translation or not, depending of the format of its filename.
      Parameters:
      _filename - the name of the file
      Returns:
      true if the file represented by _filename is a translation, false otherwise
    • matchTranslation

      public Matcher matchTranslation(String _filename)
      Compares the given filename on a defined pattern to identify its parts (name, lang, type).
      Parameters:
      _filename - the filename to match on the pattern
      Returns:
      the Matcher object
    • prepareCrowdinTranslation

      public CrowdinTranslation prepareCrowdinTranslation(CrowdinFile _master, File _translationFile)
      Creates and return a CrowdinTranslation.
      Parameters:
      _master - The master CrowdinFile for this translation
      _translationFile - the real File
      Returns:
      the CrowdinTranslation object that represents this translation file.
    • encodeMinusCharacterInPath

      public static String encodeMinusCharacterInPath(String path, boolean isEncode)
      Parameters:
      path - path
      isEncode - encode minus characters in path if isEncode is true, decode minus characters if isEncode is false,
      Returns:
      encoded or decoded path