Example usage for java.net URLConnection getUseCaches

List of usage examples for java.net URLConnection getUseCaches

Introduction

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

Prototype

public boolean getUseCaches() 

Source Link

Document

Returns the value of this URLConnection 's useCaches field.

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.getUseCaches());
}

From source file:MainClass.java

public static void main(String[] args) {
    URL u;//from  ww  w. j  a v  a 2s .  c om
    URLConnection uc;
    try {
        u = new URL("http://www.java2s.com");
        try {
            uc = u.openConnection();
            if (uc.getUseCaches()) {
                uc.setUseCaches(false);
            }
        } catch (IOException e) {
            System.err.println(e);
        }
    } catch (MalformedURLException e) {
        System.err.println(e);
    }

}