@@ -74,6 +74,8 @@ public class ChannelFinderClientImpl implements ChannelFinderClient {
74
74
private static final String resourceProperties = "resources/properties" ;
75
75
private static final String resourceTags = "resources/tags" ;
76
76
77
+
78
+ private static CFProperties properties = new CFProperties ();
77
79
private static final Logger log = Logger .getLogger (ChannelFinderClient .class .getName ());
78
80
/**
79
81
* A Builder class to help create the client to the Channelfinder Service
@@ -101,11 +103,10 @@ public static class CFCBuilder {
101
103
102
104
private ExecutorService executor = Executors .newSingleThreadExecutor ();
103
105
104
- private CFProperties properties = new CFProperties ();
105
106
106
107
private CFCBuilder ()
107
108
{
108
- this .uri = URI .create (this . properties .getPreferenceValue ("serviceURL" ));
109
+ this .uri = URI .create (properties .getPreferenceValue ("serviceURL" ));
109
110
this .protocol = this .uri .getScheme ();
110
111
}
111
112
@@ -263,21 +264,24 @@ public boolean verify(String hostname, SSLSession session) {
263
264
properties .getPreferenceValue ("username" ),
264
265
properties .getPreferenceValue ("password" ));
265
266
}
267
+
266
268
return new ChannelFinderClientImpl (this .uri , this .clientConfig , this .httpBasicAuthFilter , this .executor );
267
269
}
268
270
}
269
271
270
272
ChannelFinderClientImpl (URI uri , ClientConfig config , HTTPBasicAuthFilter httpBasicAuthFilter ,
271
273
ExecutorService executor ) {
272
274
Client client = Client .create (config );
275
+ client .setFollowRedirects (true );
273
276
cfResource = client .resource (uri .toString ());
277
+ cfAuthenticatedResource = client .resource (uri .toString ());
274
278
if (httpBasicAuthFilter != null ) {
275
- client .addFilter (httpBasicAuthFilter );
279
+ cfAuthenticatedResource .addFilter (httpBasicAuthFilter );
276
280
}
277
281
// 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
+ }
281
285
this .executor = executor ;
282
286
}
283
287
0 commit comments