Methods Summary |
---|
public static java.io.File | createTempFile(java.lang.String suffix)
return File.createTempFile("hyts_", suffix, null);
|
public static java.io.File | getExternalLocalFile(java.lang.String url)
File temp = cache.get(url);
if (temp == null) {
InputStream in = new URL(url).openStream();
temp = File.createTempFile("hyts_local", ".tmp", null);
temp.deleteOnExit();
FileOutputStream out = new FileOutputStream(temp);
int result;
byte[] buf = new byte[4096];
while ((result = in.read(buf)) != -1) {
out.write(buf, 0, result);
}
in.close();
out.close();
cache.put(url, temp);
}
return temp;
|
public static java.net.JarURLConnection | getJarURLConnection()
JarURLConnection con1 = null;
File file = getLocalFile("hyts_att.jar");
URL fUrl1 = new URL("jar:file:" + file.getPath() + "!/");
con1 = (JarURLConnection) fUrl1.openConnection();
return con1;
|
public static java.io.File | getLocalFile(java.lang.String url)
url = Support_Resources.RESOURCE_PACKAGE + url;
File temp = cache.get(url);
if (temp == null) {
InputStream in = Support_GetLocal.class.getResourceAsStream(url);
temp = File.createTempFile("hyts_local", ".tmp", null);
temp.deleteOnExit();
FileOutputStream out = new FileOutputStream(temp);
int result;
byte[] buf = new byte[4096];
while ((result = in.read(buf)) != -1) {
out.write(buf, 0, result);
}
in.close();
out.close();
cache.put(url, temp);
}
return temp;
|
static java.io.ByteArrayInputStream | getStream(java.lang.String url)
InputStream in = new URL(url).openStream();
ByteArrayOutputStream out = new ByteArrayOutputStream(256);
int result;
byte[] buf = new byte[256];
while ((result = in.read(buf)) != -1) {
out.write(buf, 0, result);
}
return new ByteArrayInputStream(out.toByteArray());
|