@Service public class TransifexServiceImpl extends Object implements TransifexService, org.springframework.beans.factory.InitializingBean
| Constructor and Description |
|---|
TransifexServiceImpl() |
| Modifier and Type | Method and Description |
|---|---|
void |
afterPropertiesSet() |
protected org.springframework.http.HttpHeaders |
basicAuthentication()
Transifex requires Basic HTTP authentication! This method adds Basic
authentication.
|
void |
createPropertiesXmlResource(String slug,
String title,
File file)
Creates the properties xml resource.
|
void |
createXhtmlResource(String slug,
String title,
String content)
Create a new XHTML resource.
|
boolean |
deleteResource(String slug)
Delete resource.
|
String |
downloadTranslatedResource(String slug,
Locale locale)
Download translated resource.
|
String |
getTranslatedResource(String slug,
Locale locale)
Gets the translated resource.
|
boolean |
resourceExists(String slug)
Checks if resource exists on Transifex
|
void |
testCredentials()
Ensure transifex credentials.
|
void |
updatePropertiesXmlResource(String slug,
String title,
File file)
Create or update Java XML Properties resource.
|
void |
updateXhtmlResource(String slug,
String title,
String content)
Create or update XHTML resource.
|
public void afterPropertiesSet()
throws Exception
afterPropertiesSet in interface org.springframework.beans.factory.InitializingBeanExceptionpublic void testCredentials()
throws TransifexException
testCredentials in interface TransifexServiceTransifexException - the transifex exceptionprotected org.springframework.http.HttpHeaders basicAuthentication()
public boolean resourceExists(String slug)
TransifexServiceresourceExists in interface TransifexServiceslug - the resource slugpublic boolean deleteResource(String slug) throws TransifexException
TransifexServicedeleteResource in interface TransifexServiceslug - the resource slugTransifexException - the transifex exceptionpublic String getTranslatedResource(String slug, Locale locale) throws TransifexException
TransifexServicegetTranslatedResource in interface TransifexServiceslug - the resource sluglocale - the localeTransifexException - the transifex exceptionpublic String downloadTranslatedResource(String slug, Locale locale) throws TransifexException
TransifexServicedownloadTranslatedResource in interface TransifexServiceslug - the sluglocale - the localeTransifexException - the transifex exceptionpublic void createXhtmlResource(String slug, String title, String content) throws IOException
TransifexServicecreateXhtmlResource in interface TransifexServiceslug - the slugtitle - the titlecontent - the contentIOException - Signals that an I/O exception has occurred.public void updateXhtmlResource(String slug, String title, String content) throws IOException
TransifexServiceupdateXhtmlResource in interface TransifexServiceslug - the slugtitle - the titlecontent - the contentIOException - Signals that an I/O exception has occurred.public void createPropertiesXmlResource(String slug, String title, File file) throws IOException
slug - the slugtitle - the titlefile - the fileIOException - Signals that an I/O exception has occurred.public void updatePropertiesXmlResource(String slug, String title, File file) throws IOException
TransifexServiceupdatePropertiesXmlResource in interface TransifexServiceslug - the slugtitle - the titlefile - the fileIOException - Signals that an I/O exception has occurred.Copyright © 2016. All rights reserved.