Package org.exoplatform.crowdin.utils
Class CrowdinAPIHelper
java.lang.Object
org.exoplatform.crowdin.utils.CrowdinAPIHelper
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionaddDirectory(String _dirName) Calls the function http://crowdin.com/page/api/add-directoryaddFile(CrowdinFile _file) Calls the function https://crowdin.com/page/api/add-filedeleteFile(CrowdinFile _file) Calls the function https://crowdin.com/page/api/delete-filevoiddownloadTranslations(File translationsFile) booleanelementExists(String _eltPath) Calls the function https://crowdin.com/page/api/infoCalls the function https://crowdin.com/page/api/edit-projectCalls the function https://crowdin.com/page/api/edit-projectupdateFile(CrowdinFile _file) Calls the function https://crowdin.com/page/api/update-fileuploadTranslation(CrowdinTranslation _file, boolean autoApprovedImported) Calls the function https://crowdin.com/page/api/upload-translation
-
Constructor Details
-
CrowdinAPIHelper
-
-
Method Details
-
addDirectory
Calls the function http://crowdin.com/page/api/add-directory- Parameters:
_dirName- the name of the directory to create (with path if the directory is nested)- Returns:
- true if the request is successful (directory created), false otherwise
- Throws:
org.apache.maven.plugin.MojoExecutionException
-
addFile
Calls the function https://crowdin.com/page/api/add-file- Parameters:
_file- the full path + name of the file- Returns:
- true if the request is successful (file added), false otherwise
- Throws:
org.apache.maven.plugin.MojoExecutionException
-
deleteFile
Calls the function https://crowdin.com/page/api/delete-file- Parameters:
_file- Crowdin file- Returns:
- true if the request is successful (file deleted), false otherwise
- Throws:
org.apache.maven.plugin.MojoExecutionException
-
elementExists
- Parameters:
_eltPath- the full path of the file/folder to check- Returns:
- true if the element exists, false otherwise
- Throws:
org.apache.maven.plugin.MojoExecutionException
-
updateFile
Calls the function https://crowdin.com/page/api/update-file- Parameters:
_file- the full path + name of the file- Returns:
- true if the request is successful (file updated), false otherwise
- Throws:
org.apache.maven.plugin.MojoExecutionException
-
uploadTranslation
public String uploadTranslation(CrowdinTranslation _file, boolean autoApprovedImported) throws org.apache.maven.plugin.MojoExecutionException Calls the function https://crowdin.com/page/api/upload-translation- Parameters:
_file- the full path + name of the translation file- Returns:
- true if the request is successful (translation uploaded), false otherwise
- Throws:
org.apache.maven.plugin.MojoExecutionException
-
getProjectInfo
Calls the function https://crowdin.com/page/api/info- Returns:
- an XML string with all information about this project
- Throws:
org.apache.maven.plugin.MojoExecutionException
-
downloadTranslations
public void downloadTranslations(File translationsFile) throws org.apache.maven.plugin.MojoExecutionException, FileNotFoundException, IOException - Parameters:
translationsFile- the File that contains all translations if the request is successful, null otherwise- Throws:
org.apache.maven.plugin.MojoExecutionExceptionFileNotFoundExceptionIOException
-
setApprovedOnlyOption
Calls the function https://crowdin.com/page/api/edit-project- Returns:
- an XML string with all information about the result
- Throws:
org.apache.maven.plugin.MojoExecutionException
-
getTranslationStatus
Calls the function https://crowdin.com/page/api/edit-project- Returns:
- an XML string with the status of translations
- Throws:
org.apache.maven.plugin.MojoExecutionException
-