@@ -58,28 +58,28 @@ public String uploadFile(File f, DCArray assets_names, DCObject meta) throws Exc
5858
5959 PostMethod filePost = null ;
6060 try
61- {
61+ {
6262 filePost = new PostMethod (upload_url );
63-
63+
6464 Part [] parts = {
65- new FilePart ("file" , f )
65+ new FilePart ("file" , f )
6666 };
6767
6868 filePost .setRequestEntity (new MultipartRequestEntity (parts , filePost .getParams ()));
6969 HttpClient client = new HttpClient ();
70- client .getHttpConnectionManager ().getParams ().setConnectionTimeout (5000 );
71-
72- int status = client .executeMethod (filePost );
73- if (status == HttpStatus .SC_OK )
74- {
75- ObjectMapper mapper = new ObjectMapper ();
76- DCObject json_response = DCObject .create (mapper .readValue (filePost .getResponseBodyAsString (), Map .class ));
77- return this .create (json_response .pull ("url" ), assets_names , meta );
78- }
79- else
80- {
81- throw new CloudKey_Exception ("Upload failed." );
82- }
70+ client .getHttpConnectionManager ().getParams ().setConnectionTimeout (5000 );
71+
72+ int status = client .executeMethod (filePost );
73+ if (status == HttpStatus .SC_OK )
74+ {
75+ ObjectMapper mapper = new ObjectMapper ();
76+ DCObject json_response = DCObject .create (mapper .readValue (filePost .getResponseBodyAsString (), Map .class ));
77+ return this .create (json_response .pull ("url" ), assets_names , meta );
78+ }
79+ else
80+ {
81+ throw new CloudKey_Exception ("Upload failed." );
82+ }
8383 }
8484 catch (Exception e )
8585 {
@@ -91,7 +91,7 @@ public String uploadFile(File f, DCArray assets_names, DCObject meta) throws Exc
9191 {
9292 filePost .releaseConnection ();
9393 }
94- }
94+ }
9595 }
9696
9797 public void delete (String id ) throws Exception
0 commit comments