mirror of
https://github.com/Athou/commafeed.git
synced 2026-03-21 21:37:29 +00:00
merge properties service into configuration
This commit is contained in:
@@ -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 {
|
||||
|
||||
@@ -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");
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user