@@ -74,6 +74,8 @@ public class ChannelFinderClientImpl implements ChannelFinderClient {
7474 private static final String resourceProperties = "resources/properties" ;
7575 private static final String resourceTags = "resources/tags" ;
7676
77+
78+ private static CFProperties properties = new CFProperties ();
7779 private static final Logger log = Logger .getLogger (ChannelFinderClient .class .getName ());
7880 /**
7981 * A Builder class to help create the client to the Channelfinder Service
@@ -101,11 +103,10 @@ public static class CFCBuilder {
101103
102104 private ExecutorService executor = Executors .newSingleThreadExecutor ();
103105
104- private CFProperties properties = new CFProperties ();
105106
106107 private CFCBuilder ()
107108 {
108- this .uri = URI .create (this . properties .getPreferenceValue ("serviceURL" ));
109+ this .uri = URI .create (properties .getPreferenceValue ("serviceURL" ));
109110 this .protocol = this .uri .getScheme ();
110111 }
111112
@@ -263,21 +264,24 @@ public boolean verify(String hostname, SSLSession session) {
263264 properties .getPreferenceValue ("username" ),
264265 properties .getPreferenceValue ("password" ));
265266 }
267+
266268 return new ChannelFinderClientImpl (this .uri , this .clientConfig , this .httpBasicAuthFilter , this .executor );
267269 }
268270 }
269271
270272 ChannelFinderClientImpl (URI uri , ClientConfig config , HTTPBasicAuthFilter httpBasicAuthFilter ,
271273 ExecutorService executor ) {
272274 Client client = Client .create (config );
275+ client .setFollowRedirects (true );
273276 cfResource = client .resource (uri .toString ());
277+ cfAuthenticatedResource = client .resource (uri .toString ());
274278 if (httpBasicAuthFilter != null ) {
275- client .addFilter (httpBasicAuthFilter );
279+ cfAuthenticatedResource .addFilter (httpBasicAuthFilter );
276280 }
277281 // TODO add a preference to add logging
278- // client.addFilter(new RawLoggingFilter(Logger.getLogger(RawLoggingFilter.class.getName( ))));
279- client .setFollowRedirects ( true );
280- cfAuthenticatedResource = client . resource ( uri . toString ());
282+ if ( Boolean . parseBoolean ( properties . getPreferenceValue ( "rawFiltering" ))) {
283+ client .addFilter ( new RawLoggingFilter ( Logger . getLogger ( RawLoggingFilter . class . getName ())) );
284+ }
281285 this .executor = executor ;
282286 }
283287
0 commit comments