JAL-1620 version bump and release notes
[jalview.git] / src / jalview / ws / HttpClientUtils.java
index 93566f8..ed7288f 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Jalview - A Sequence Alignment Editor and Viewer (Version 2.8.2)
+ * Jalview - A Sequence Alignment Editor and Viewer (Version 2.8.2b1)
  * Copyright (C) 2014 The Jalview Authors
  * 
  * This file is part of Jalview.
@@ -43,8 +43,9 @@ import org.apache.http.impl.client.DefaultHttpClient;
 
 /**
  * Helpful procedures for working with services via HTTPClient
+ * 
  * @author jimp
- *
+ * 
  */
 public class HttpClientUtils
 {
@@ -83,18 +84,20 @@ public class HttpClientUtils
   }
 
   public static BufferedReader doHttpMpartFilePost(String postUrl,
-          List<NameValuePair> vals, String fparm,File file, String mtype) throws ClientProtocolException,
-          IOException
+          List<NameValuePair> vals, String fparm, File file, String mtype)
+          throws ClientProtocolException, IOException
   {
     HttpClient httpclient = new DefaultHttpClient();
     HttpPost httppost = new HttpPost(postUrl);
-    MultipartEntity mpe = new MultipartEntity(HttpMultipartMode.BROWSER_COMPATIBLE);
-    for (NameValuePair nvp:vals)
+    MultipartEntity mpe = new MultipartEntity(
+            HttpMultipartMode.BROWSER_COMPATIBLE);
+    for (NameValuePair nvp : vals)
     {
       mpe.addPart(nvp.getName(), new StringBody(nvp.getValue()));
     }
-    
-    FileBody fb = new FileBody(file, mtype!=null ? mtype : "application/octet-stream");
+
+    FileBody fb = new FileBody(file, mtype != null ? mtype
+            : "application/octet-stream");
     mpe.addPart(fparm, fb);
     UrlEncodedFormEntity ue = new UrlEncodedFormEntity(vals, "UTF-8");
     httppost.setEntity(ue);
@@ -112,19 +115,22 @@ public class HttpClientUtils
       return null;
     }
   }
+
   public static BufferedReader doHttpMpartInputstreamPost(String postUrl,
-          List<NameValuePair> vals, String fparm,String fname, InputStream is, String mtype) throws ClientProtocolException,
+          List<NameValuePair> vals, String fparm, String fname,
+          InputStream is, String mtype) throws ClientProtocolException,
           IOException
   {
     HttpClient httpclient = new DefaultHttpClient();
     HttpPost httppost = new HttpPost(postUrl);
     MultipartEntity mpe = new MultipartEntity(HttpMultipartMode.STRICT);
-    for (NameValuePair nvp:vals)
+    for (NameValuePair nvp : vals)
     {
       mpe.addPart(nvp.getName(), new StringBody(nvp.getValue()));
     }
-    
-    InputStreamBody fb = (mtype!=null) ? new InputStreamBody(is, fname, mtype) : new InputStreamBody(is, fname);
+
+    InputStreamBody fb = (mtype != null) ? new InputStreamBody(is, fname,
+            mtype) : new InputStreamBody(is, fname);
     mpe.addPart(fparm, fb);
     UrlEncodedFormEntity ue = new UrlEncodedFormEntity(vals, "UTF-8");
     httppost.setEntity(ue);