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  

URLConnection:
  1. URLConnection
  2. URLConnection: connect() throws IOException
  3. URLConnection: getContentEncoding()
  4. URLConnection: getExpiration()
  5. URLConnection: getHeaderFields()
  6. URLConnection: getHeaderField(int n)
  7. URLConnection: getHeaderFieldKey(int n)
  8. URLConnection: getIfModifiedSince()
  9. URLConnection: getLastModified()
  10. URLConnection: getURL()
  11. URLConnection: setAllowUserInteraction(boolean allowuserinteraction)
  12. URLConnection: setDoOutput(boolean dooutput)
  13. URLConnection: setIfModifiedSince(long ifmodifiedsince)
  14. URLConnection: setRequestProperty(String key, String value)
  15. URLConnection: setUseCaches(boolean usecaches)