Index: build.xml =================================================================== RCS file: /cvs/utilities/build.xml,v retrieving revision 1.8 diff -w -r1.8 build.xml 66a67,68 > > 69c71 < value="${xercesjar}:${log4jjar}:${httpjar}" /> --- > value="${xercesjar}:${log4jjar}:${httpjar}:${jglobusjar}:${jgssjar}:${xalanjar}" /> 97a100 > source="1.4" target="1.4" 164a168 > source="1.4" target="1.4" Index: src/java/edu/ucsb/nceas/utilities/HttpMessage.java =================================================================== RCS file: /cvs/utilities/src/java/edu/ucsb/nceas/utilities/HttpMessage.java,v retrieving revision 1.3 diff -w -r1.3 HttpMessage.java 27,30d26 < import java.io.*; < import java.net.*; < import java.util.*; < 32a29,36 > import java.io.*; > import java.net.HttpURLConnection; > import java.net.URL; > import java.net.URLConnection; > import java.net.URLEncoder; > import java.util.Enumeration; > import java.util.Properties; > 35,39c39,42 < private URL servlet = null; < private String argString = null; < private static String cookie = null; < private OutputStream out = null; < private URLConnection con = null; --- > protected URL servlet = null; > protected String cookie = null; > protected OutputStream out = null; > protected URLConnection con = null; 61c64 < argString = "";//default --- > String argString = ""; 79c82 < private void openPostConnection() throws IOException --- > protected void openPostConnection() throws IOException 153c156 < ((HttpURLConnection)con).setRequestProperty("Content-Type", ctype); --- > con.setRequestProperty("Content-Type", ctype); 155,156c158 < ((HttpURLConnection)con).setRequestProperty("Content-Length", < new Long(contentLength).toString()); --- > con.setRequestProperty("Content-Length", Long.toString(contentLength)); 159c161 < out = con.getOutputStream(); --- > out = getConOutputStream(); 214c216 < ((HttpURLConnection)con).setRequestProperty("Content-Type", ctype); --- > con.setRequestProperty("Content-Type", ctype); 216,217c218 < ((HttpURLConnection)con).setRequestProperty("Content-Length", < new Long(contentLength).toString()); --- > con.setRequestProperty("Content-Length", Long.toString(contentLength)); 220c221 < out = con.getOutputStream(); --- > out = getConOutputStream(); 227a229,256 > /** If true, ignore all flush() calls during POST connections > * (that is, during sendPostData calls) until the connection is > * closed. Useful because flush() calls on a GSS SSL stream close the > * stream. */ > protected boolean ignoreOutputStreamFlushes = false; > > /** If ignoreOutputStreamFlushes is true, wrap o in a > * stream that simply ignores all flush()es until it is closed. > * No effect if ignoreOutputStreamFlushes is false. */ > private OutputStream wrapFlushes(OutputStream o) { > if (!ignoreOutputStreamFlushes) return o; > else return new FilterOutputStream(o) { > public void flush() {} // ignore flushes > public void close() throws IOException { > //noinspection EmptyCatchBlock > try { super.flush(); } // but make sure they happen on close > catch (IOException ignored) {} > super.close(); > } > }; > } > > /** Call this rather than calling con.getOutputStream() directly, > * to properly wrap a GSI SSL output stream. */ > protected OutputStream getConOutputStream() throws IOException { > return wrapFlushes(con.getOutputStream()); > } > 240c269 < out = new DataOutputStream(con.getOutputStream()); --- > out = new DataOutputStream(getConOutputStream()); 272c301 < private InputStream closePostConnection() throws IOException --- > protected InputStream closePostConnection() throws IOException 297c326 < return sendPostMessage(null); --- > return sendPostData(null); 319c348 < private String toEncodedString(Properties args) --- > protected static String toEncodedString(Properties args) 327c356,357 < buf.append(URLEncoder.encode(name) + "=" + URLEncoder.encode(value)); --- > buf.append(URLEncoder.encode(name)).append("=") > .append(URLEncoder.encode(value)); 337c367 < public static String getCookie() --- > public String getCookie() 345c375 < public static void setCookie(String newCookie) --- > public void setCookie(String newCookie)