Code example for URLConnection

Methods: getInputStream, setUseCaches

0
            return openFile(s);
        } 
        InputStream inputstream;
        try { 
            URLConnection urlconnection = url.openConnection();
            urlconnection.setUseCaches(false);
            inputstream = urlconnection.getInputStream();
        } 
        catch (IOException ioexception) {
            ioexception.printStackTrace(System.out);
            return null; 
        } 
        return inputstream;
    } 
 
    //slightly shorter StringBuffer version 
    public static synchronized String getLineFromURL(InputStream myInputStream) {
        int ch = -1;
        StringBuffer sb = new StringBuffer(256);
        while (true) { 
            try {