Project

General

Profile

« Previous | Next » 

Revision 9096

organize imports. move exception-throwing method call into try block.

View differences:

src/edu/ucsb/nceas/metacat/replication/ReplicationService.java
34 34
import java.io.FileOutputStream;
35 35
import java.io.IOException;
36 36
import java.io.InputStream;
37
import java.io.InputStreamReader;
38 37
import java.io.OutputStream;
39 38
import java.io.StringReader;
40 39
import java.io.Writer;
......
61 60
import javax.servlet.http.HttpServletResponse;
62 61

  
63 62
import org.apache.commons.io.IOUtils;
64
import org.apache.http.HttpResponse;
65 63
import org.apache.http.conn.scheme.Scheme;
66 64
import org.apache.http.conn.ssl.SSLSocketFactory;
67 65
import org.apache.log4j.Logger;
68
import org.dataone.client.rest.DefaultHttpMultipartRestClient;
66
import org.dataone.client.auth.CertificateManager;
69 67
import org.dataone.client.rest.HttpMultipartRestClient;
70
import org.dataone.client.rest.RestClient;
71
import org.dataone.client.auth.CertificateManager;
72 68
import org.dataone.service.types.v1.Identifier;
73 69
import org.dataone.service.types.v2.SystemMetadata;
74 70
import org.dataone.service.util.DateTimeMarshaller;
......
2317 2313
	 * @return
2318 2314
	 */
2319 2315
	private static HttpMultipartRestClient getSSLClient() {
2320
		HttpMultipartRestClient client = new HttpMultipartRestClient();
2321 2316
		
2317
		HttpMultipartRestClient client = null;
2318
		
2322 2319
		// set up this server's client identity
2323 2320
		String subject = null;
2324 2321
		try {
......
2340 2337

  
2341 2338
		SSLSocketFactory socketFactory = null;
2342 2339
		try {
2340

  
2343 2341
			socketFactory = CertificateManager.getInstance().getSSLSocketFactory(subject);
2344 2342
		} catch (FileNotFoundException e) {
2345 2343
			// these are somewhat expected for anonymous client use
......
2351 2349
		try {
2352 2350
			//443 is the default port, this value is overridden if explicitly set in the URL
2353 2351
			Scheme sch = new Scheme("https", 443, socketFactory);
2352
			client = new HttpMultipartRestClient();
2354 2353
			client.getHttpClient().getConnectionManager().getSchemeRegistry().register(sch);
2355 2354
		} catch (Exception e) {
2356 2355
			// this is likely more severe

Also available in: Unified diff