URLConnection: setAllowUserInteraction(boolean allowuserinteraction)
import java.io.IOException;
import java.net.MalformedURLException;
import java.net.URL;
import java.net.URLConnection;
public class MainClass {
public static void main(String[] args) {
try {
MyHttpHandler handler = new MyHttpHandler();
URLConnection uc = handler.openConnection(new URL("http://www.ora.com"));
if (!uc.getAllowUserInteraction()) {
uc.setAllowUserInteraction(true);
}
} catch (MalformedURLException e) {
System.err.println(e);
} catch (IOException e) {
System.err.println(e);
}
}
}
class MyHttpHandler extends sun.net.www.protocol.http.Handler {
public URLConnection openConnection(URL u) throws IOException {
return super.openConnection(u);
}
}
Home
Java Book
Networking
Java Book
Networking
URLConnection:
- URLConnection
- URLConnection: connect() throws IOException
- URLConnection: getContentEncoding()
- URLConnection: getExpiration()
- URLConnection: getHeaderFields()
- URLConnection: getHeaderField(int n)
- URLConnection: getHeaderFieldKey(int n)
- URLConnection: getIfModifiedSince()
- URLConnection: getLastModified()
- URLConnection: getURL()
- URLConnection: setAllowUserInteraction(boolean allowuserinteraction)
- URLConnection: setDoOutput(boolean dooutput)
- URLConnection: setIfModifiedSince(long ifmodifiedsince)
- URLConnection: setRequestProperty(String key, String value)
- URLConnection: setUseCaches(boolean usecaches)