List of utility methods to do URL Load
String | loadFully(URL url) load Fully ByteArrayOutputStream baos = new ByteArrayOutputStream(); byte[] buf = new byte[4096]; int l; InputStream is = url.openStream(); try { while ((l = is.read(buf)) >= 0) { baos.write(buf, 0, l); } finally { is.close(); return baos.toString(); |
List | loadImplementations(URL url, ClassLoader loader) load Implementations InputStream inputStream = url.openStream(); BufferedReader reader = new BufferedReader(new InputStreamReader(inputStream)); String classLine = reader.readLine(); ArrayList<Class> classList = new ArrayList<>(); while (classLine != null) { Class clz = loader.loadClass(classLine); classList.add(clz); classLine = reader.readLine(); ... |
Manifest | loadManifest(URL url) Loads a manifest from the given URL if (url == null) { return null; InputStream in = url.openStream(); try { return new Manifest(in); } finally { in.close(); ... |
Object | loadObject(URL url) load Object return loadObject(url, false);
|
Properties | loadProperties(final URL url) Loads a property file from given URL. Properties newprops = new Properties(); InputStream in = null; try { in = url.openStream(); newprops.load(in); } finally { close(in); return newprops; |
void | loadProperties(Properties p, URL url) load Properties InputStream propIn = url.openStream(); try { p.load(propIn); } finally { closeStream(propIn); |
Properties | loadProperties(URL url) load Properties try { return loadProperties(url.openStream()); } catch (Exception e) { return null; |
Properties | loadProperties(URL url) load Properties Properties props = null; try { InputStream stream = url.openStream(); props = new Properties(); props.load(stream); } catch (Exception e) { } finally { return props; |
Properties | loadPropertiesFromFileOrURL(String propertiesFile) Create a java properties object from a location. if (propertiesFile == null || propertiesFile.length() == 0) { throw new IOException("No file provided"); InputStream inputStream = null; String location; String parentFolder; try { URL temp = new URL(propertiesFile); ... |
Properties | loadPropertiesFromURL(URL url) load Properties From URL InputStream is = null; try { is = url.openStream(); Properties prop = new Properties(); prop.load(is); return prop; } finally { is.close(); ... |