merge properties service into configuration

This commit is contained in:
Athou
2014-08-16 17:27:27 +02:00
parent b886379d34
commit b051613b62
5 changed files with 22 additions and 31 deletions

View File

@@ -44,7 +44,7 @@ import org.apache.http.impl.client.HttpClients;
import org.apache.http.protocol.HttpContext;
import org.apache.http.util.EntityUtils;
import com.commafeed.backend.service.ApplicationPropertiesService;
import com.commafeed.CommaFeedConfiguration;
/**
* Smart HTTP getter: handles gzip, ssl, last modified and etag headers
@@ -95,8 +95,8 @@ public class HttpGetter {
private final String userAgent;
public HttpGetter(ApplicationPropertiesService applicationPropertiesService) {
this.userAgent = String.format("CommaFeed/%s (https://www.commafeed.com)", applicationPropertiesService.getVersion());
public HttpGetter(CommaFeedConfiguration config) {
this.userAgent = String.format("CommaFeed/%s (https://www.commafeed.com)", config.getVersion());
}
public HttpResult getBinary(String url, int timeout) throws ClientProtocolException, IOException, NotModifiedException {

View File

@@ -1,20 +0,0 @@
package com.commafeed.backend.service;
import java.util.ResourceBundle;
public class ApplicationPropertiesService {
private ResourceBundle bundle;
public ApplicationPropertiesService() {
bundle = ResourceBundle.getBundle("application");
}
public String getVersion() {
return bundle.getString("version");
}
public String getGitCommit() {
return bundle.getString("git.commit");
}
}