Example usage for java.net URLConnection getAllowUserInteraction

List of usage examples for java.net URLConnection getAllowUserInteraction

Introduction

In this page you can find the example usage for java.net URLConnection getAllowUserInteraction.

Prototype

public boolean getAllowUserInteraction() 

Source Link

Document

Returns the value of the allowUserInteraction field for this object.

Usage

From source file:Main.java

public static void main(String args[]) throws Exception {

    URL u = new URL("http://www.java2s.com");
    URLConnection uc = u.openConnection();

    System.out.println(uc.getAllowUserInteraction());
}

From source file:Main.java

public static void main(String args[]) throws Exception {

    URL u = new URL("http://www.java2s.com");
    URLConnection uc = u.openConnection();

    uc.setAllowUserInteraction(true);/*from  ww w  .j  a v a 2s . c  o  m*/
    System.out.println(uc.getAllowUserInteraction());
}

From source file:MainClass.java

public static void main(String[] args) {
    try {/*from w  w  w.  j ava2 s.com*/
        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);
    }

}