import java.io.File; import java.io.FileInputStream; import java.io.FileOutputStream; import java.io.IOException; import java.io.InputStream; import java.io.OutputStream; import javax.xml.parsers.DocumentBuilder; import javax.xml.parsers.DocumentBuilderFactory; import javax.xml.xpath.XPath; import javax.xml.xpath.XPathConstants; import javax.xml.xpath.XPathExpression; import javax.xml.xpath.XPathFactory; import org.apache.http.HttpResponse; import org.apache.http.client.methods.HttpGet; import org.apache.http.impl.client.DefaultHttpClient; import org.apache.http.params.BasicHttpParams; import org.apache.http.params.HttpConnectionParams; import org.apache.http.params.HttpParams; import org.w3c.dom.Document; public class updater { try{ DefaultHttpClient httpclient = ClientMaker(); HttpGet get = new HttpGet("http://w...content-available-to-author-only...r.com/path/to/Version.xml"); HttpResponse response = httpclient.execute(get); DocumentBuilderFactory domFactory = DocumentBuilderFactory.newInstance(); DocumentBuilder builder = domFactory.newDocumentBuilder(); //Parse the Xml. XPathFactory factory = XPathFactory.newInstance(); XPath xpath = factory.newXPath(); XPathExpression expr = xpath.compile("//version/number/text()"); doc = builder.parse(in); expr=xpath.compile("//version/number/text()"); HttpGet get2 = new HttpGet("http://w...content-available-to-author-only...r.com/path/to/MyJar.jar"); HttpResponse response2 = httpclient.execute(get2); byte buf[] = new byte[1024]; int len; while ((len = in2.read(buf)) > 0) { fos.write(buf, 0, len); } fos.close(); in.close(); } p.waitFor(); p.destroy(); } public static DefaultHttpClient ClientMaker() { int connectiontimeout = 30000; // 1 second int sockettimeout = 1000; HttpParams httpparameters = new BasicHttpParams(); HttpConnectionParams.setConnectionTimeout(httpparameters, connectiontimeout); HttpConnectionParams.setSoTimeout(httpparameters, connectiontimeout); DefaultHttpClient httpclient = new DefaultHttpClient(httpparameters); return httpclient; } }
Standard input is empty
Main.java:25: class updater is public, should be declared in a file named updater.java public class updater { ^ Main.java:15: package org.apache.http does not exist import org.apache.http.HttpResponse; ^ Main.java:16: package org.apache.http.client.methods does not exist import org.apache.http.client.methods.HttpGet; ^ Main.java:17: package org.apache.http.impl.client does not exist import org.apache.http.impl.client.DefaultHttpClient; ^ Main.java:18: package org.apache.http.params does not exist import org.apache.http.params.BasicHttpParams; ^ Main.java:19: package org.apache.http.params does not exist import org.apache.http.params.HttpConnectionParams; ^ Main.java:20: package org.apache.http.params does not exist import org.apache.http.params.HttpParams; ^ Main.java:74: cannot find symbol symbol : class DefaultHttpClient location: class updater public static DefaultHttpClient ClientMaker() { ^ Main.java:28: cannot find symbol symbol : class DefaultHttpClient location: class updater DefaultHttpClient httpclient = ClientMaker(); ^ Main.java:29: cannot find symbol symbol : class HttpGet location: class updater HttpGet get = new HttpGet("http://www.myserver.com/path/to/Version.xml"); ^ Main.java:29: cannot find symbol symbol : class HttpGet location: class updater HttpGet get = new HttpGet("http://www.myserver.com/path/to/Version.xml"); ^ Main.java:30: cannot find symbol symbol : class HttpResponse location: class updater HttpResponse response = httpclient.execute(get); ^ Main.java:53: cannot find symbol symbol : class HttpGet location: class updater HttpGet get2 = new HttpGet("http://www.myserver.com/path/to/MyJar.jar"); ^ Main.java:53: cannot find symbol symbol : class HttpGet location: class updater HttpGet get2 = new HttpGet("http://www.myserver.com/path/to/MyJar.jar"); ^ Main.java:54: cannot find symbol symbol : class HttpResponse location: class updater HttpResponse response2 = httpclient.execute(get2); ^ Main.java:76: cannot find symbol symbol : class HttpParams location: class updater HttpParams httpparameters = new BasicHttpParams(); ^ Main.java:76: cannot find symbol symbol : class BasicHttpParams location: class updater HttpParams httpparameters = new BasicHttpParams(); ^ Main.java:77: cannot find symbol symbol : variable HttpConnectionParams location: class updater HttpConnectionParams.setConnectionTimeout(httpparameters, ^ Main.java:79: cannot find symbol symbol : variable HttpConnectionParams location: class updater HttpConnectionParams.setSoTimeout(httpparameters, connectiontimeout); ^ Main.java:80: cannot find symbol symbol : class DefaultHttpClient location: class updater DefaultHttpClient httpclient = new DefaultHttpClient(httpparameters); ^ Main.java:80: cannot find symbol symbol : class DefaultHttpClient location: class updater DefaultHttpClient httpclient = new DefaultHttpClient(httpparameters); ^ 21 errors
Standard output is empty