Skip to content
This repository has been archived by the owner on Nov 9, 2017. It is now read-only.

Commit

Permalink
Make rest prefix a proteted metho instead of static property.
Browse files Browse the repository at this point in the history
  • Loading branch information
Carlos Munoz committed Jun 16, 2013
1 parent a72a154 commit a367098
Showing 1 changed file with 7 additions and 3 deletions.
Expand Up @@ -34,7 +34,6 @@ public class ZanataProxyFactory implements ITranslationResourcesFactory

private static final Logger log = LoggerFactory.getLogger(ZanataProxyFactory.class);
private final ClientRequestFactory crf;
private static final String RESOURCE_PREFIX = "rest";

public ZanataProxyFactory(String username, String apiKey, VersionInfo clientApiVersion)
{
Expand Down Expand Up @@ -89,18 +88,23 @@ else if (serverVersion.contains(RestConstant.SNAPSHOT_VERSION) && !serverTimesta
/**
* Returns the Base url to be used for rest Requests.
*/
protected URL getBaseUrl()
private URL getBaseUrl()
{
try
{
return new URL(fixBase(crf.getBase()).toString() + RESOURCE_PREFIX);
return new URL(fixBase(crf.getBase()).toString() + getUrlPrefix());
}
catch (MalformedURLException e)
{
throw new RuntimeException(e);
}
}

protected String getUrlPrefix()
{
return "rest";
}

public <T> T createProxy(Class<T> clazz, URI baseUri)
{
log.debug("{} proxy uri: {}", clazz.getSimpleName(), baseUri);
Expand Down

0 comments on commit a367098

Please sign in to comment.