Package org.exoplatform.crowdin.model
Class CrowdinFileFactory
java.lang.Object
org.exoplatform.crowdin.model.CrowdinFileFactory
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic StringencodeMinusCharacterInPath(String path, boolean isEncode) booleanisTranslation(String _filename) Checks whether a file is a translation or not, depending of the format of its filename.matchTranslation(String _filename) Compares the given filename on a defined pattern to identify its parts (name, lang, type).prepareCrowdinFile(String _path, String _name, String _project) Creates and returns a CrowdinFile (master).prepareCrowdinTranslation(CrowdinFile _master, File _translationFile) Creates and return a CrowdinTranslation.
-
Constructor Details
-
CrowdinFileFactory
-
-
Method Details
-
prepareCrowdinFile
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
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
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
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
- Parameters:
path- pathisEncode- encode minus characters in path if isEncode is true, decode minus characters if isEncode is false,- Returns:
- encoded or decoded path
-