public class CrowdinAPI extends Object
| Modifier and Type | Method and Description |
|---|---|
static org.apache.http.impl.client.CloseableHttpClient |
createHTTPClient()
Creates a new
CloseableHttpClient instance. |
static org.jdom2.Element |
getFiles(org.apache.http.client.HttpClient httpClient,
org.apache.maven.settings.Server server,
String branch,
org.jdom2.Document projectDetails,
org.apache.maven.plugin.logging.Log logger)
Requests project information including all files and returns the files
element.
|
static org.jdom2.Document |
requestGetDocument(org.apache.http.client.HttpClient httpClient,
org.apache.maven.settings.Server server,
String method,
Map<String,String> parameters,
org.apache.maven.plugin.logging.Log logger)
Makes a GET request to the Crowdin API and returns the result as a
Document. |
static org.apache.http.HttpResponse |
requestPost(org.apache.http.client.HttpClient httpClient,
org.apache.maven.settings.Server server,
String method,
Map<String,String> parameters,
org.apache.maven.plugin.logging.Log logger)
Makes a POST request to the Crowdin API and returns the
HttpResponse. |
static org.apache.http.HttpResponse |
requestPost(org.apache.http.client.HttpClient httpClient,
org.apache.maven.settings.Server server,
String method,
Map<String,String> parameters,
Map<String,File> files,
Map<String,String> titles,
Map<String,String> patterns,
org.apache.maven.plugin.logging.Log logger)
Makes a POST request to the Crowdin API and returns the
HttpResponse. |
static org.jdom2.Document |
requestPostDocument(org.apache.http.client.HttpClient httpClient,
org.apache.maven.settings.Server server,
String method,
Map<String,String> parameters,
Map<String,File> files,
boolean mustSucceed,
org.apache.maven.plugin.logging.Log logger)
Makes a POST request to the Crowdin API and returns the result as a
Document. |
static org.jdom2.Document |
requestPostDocument(org.apache.http.client.HttpClient httpClient,
org.apache.maven.settings.Server server,
String method,
Map<String,String> parameters,
Map<String,File> files,
Map<String,String> titles,
Map<String,String> patterns,
boolean mustSucceed,
org.apache.maven.plugin.logging.Log logger)
Makes a POST request to the Crowdin API and returns the result as a
Document. |
public static org.apache.http.impl.client.CloseableHttpClient createHTTPClient()
throws IOException
CloseableHttpClient instance.CloseableHttpClient.IOException - If an error occurs during the operation.@Nullable public static org.jdom2.Element getFiles(@Nonnull org.apache.http.client.HttpClient httpClient, @Nonnull org.apache.maven.settings.Server server, @Nullable String branch, @Nullable org.jdom2.Document projectDetails, @Nullable org.apache.maven.plugin.logging.Log logger) throws IOException
null in which case the root files
Element is returned.httpClient - the HttpClient to use.server - the Server to use for Crowdin credentials.branch - the branch name.projectDetails - the project details.logger - the Log instance to use for logging.Element.IOException - If an error occurs during the operation.@Nonnull public static org.jdom2.Document requestGetDocument(@Nonnull org.apache.http.client.HttpClient httpClient, @Nonnull org.apache.maven.settings.Server server, @Nonnull String method, @Nullable Map<String,String> parameters, @Nullable org.apache.maven.plugin.logging.Log logger) throws IOException
Document.httpClient - the HttpClient to use.server - the Server to use for Crowdin credentials.method - the API method to use.parameters - the Map of API parameters to use.logger - the Log instance to use for logging.Document.IOException - If an error occurs during the operation.IllegalArgumentException - If method is blank.@Nonnull public static org.jdom2.Document requestPostDocument(@Nonnull org.apache.http.client.HttpClient httpClient, @Nonnull org.apache.maven.settings.Server server, @Nonnull String method, @Nullable Map<String,String> parameters, @Nullable Map<String,File> files, boolean mustSucceed, @Nullable org.apache.maven.plugin.logging.Log logger) throws IOException
Document.httpClient - the HttpClient to use.server - the Server to use for Crowdin credentials.method - the API method to use.parameters - the Map of API parameters to use.files - the Map of files to use.mustSucceed - whether to throw a IOException if the returned
Document contains an error code.logger - the Log instance to use for logging.Document.IOException - If an error occurs during the operation.IllegalArgumentException - If method is blank.@Nonnull public static org.jdom2.Document requestPostDocument(@Nonnull org.apache.http.client.HttpClient httpClient, @Nonnull org.apache.maven.settings.Server server, @Nonnull String method, @Nullable Map<String,String> parameters, @Nullable Map<String,File> files, @Nullable Map<String,String> titles, @Nullable Map<String,String> patterns, boolean mustSucceed, @Nullable org.apache.maven.plugin.logging.Log logger) throws IOException
Document.httpClient - the HttpClient to use.server - the Server to use for Crowdin credentials.method - the API method to use.parameters - the Map of API parameters to use.files - the Map of files to use.titles - the Map of titles to use.patterns - the Map of patterns to use.mustSucceed - whether to throw a IOException if the returned
Document contains an error code.logger - the Log instance to use for logging.Document.IOException - If an error occurs during the operation.IllegalArgumentException - If method is blank.@Nonnull public static org.apache.http.HttpResponse requestPost(@Nonnull org.apache.http.client.HttpClient httpClient, @Nonnull org.apache.maven.settings.Server server, @Nonnull String method, @Nullable Map<String,String> parameters, @Nullable org.apache.maven.plugin.logging.Log logger) throws IOException
HttpResponse.httpClient - the HttpClient to use.server - the Server to use for Crowdin credentials.method - the API method to use.parameters - the Map of API parameters to use.logger - the Log instance to use for logging.HttpResponse.IOException - If an error occurs during the operation.IllegalArgumentException - If method is blank.@Nonnull public static org.apache.http.HttpResponse requestPost(@Nonnull org.apache.http.client.HttpClient httpClient, @Nonnull org.apache.maven.settings.Server server, @Nonnull String method, @Nullable Map<String,String> parameters, @Nullable Map<String,File> files, @Nullable Map<String,String> titles, @Nullable Map<String,String> patterns, @Nullable org.apache.maven.plugin.logging.Log logger) throws IOException
HttpResponse.httpClient - the HttpClient to use.server - the Server to use for Crowdin credentials.method - the API method to use.parameters - the Map of API parameters to use.files - the Map of files to use.titles - the Map of titles to use.patterns - the Map of patterns to use.logger - the Log instance to use for logging.HttpResponse.IOException - If an error occurs during the operation.IllegalArgumentException - If method is blank.Copyright © 2018. All rights reserved.