/** * Download of an image by URL. * * @param urlStr * The URL of a Photo * @return BufferedImage The The Image */ public BufferedImage getImage(String urlStr) throws FlickrException { InputStream in = null; try { URL url = new URL(urlStr); HttpsURLConnection conn = (HttpsURLConnection) url.openConnection(); if (transport instanceof REST) { if (((REST) transport).isProxyAuth()) { conn.setRequestProperty("Proxy-Authorization", "Basic " + ((REST) transport).getProxyCredentials()); } } conn.connect(); in = conn.getInputStream(); return ImageIO.read(in); } catch (IOException e) { throw new FlickrException(e.getMessage(), e.getCause()); } finally { IOUtilities.close(in); } } }
/** * Download of an image by URL. * * @param urlStr * The URL of a Photo * @return BufferedImage The The Image */ public BufferedImage getImage(String urlStr) throws FlickrException { InputStream in = null; try { URL url = new URL(urlStr); HttpsURLConnection conn = (HttpsURLConnection) url.openConnection(); if (transport instanceof REST) { if (((REST) transport).isProxyAuth()) { conn.setRequestProperty("Proxy-Authorization", "Basic " + ((REST) transport).getProxyCredentials()); } } conn.connect(); in = conn.getInputStream(); return ImageIO.read(in); } catch (IOException e) { throw new FlickrException(e.getMessage(), e.getCause()); } finally { IOUtilities.close(in); } } }
HttpsURLConnection conn = (HttpsURLConnection) url.openConnection(); if (transport instanceof REST) { if (((REST) transport).isProxyAuth()) { conn.setRequestProperty("Proxy-Authorization", "Basic " + ((REST) transport).getProxyCredentials());
HttpsURLConnection conn = (HttpsURLConnection) url.openConnection(); if (transport instanceof REST) { if (((REST) transport).isProxyAuth()) { conn.setRequestProperty("Proxy-Authorization", "Basic " + ((REST) transport).getProxyCredentials());