?? e138. getting a jar file using a url.txt
字號:
try {
// Create a URL that refers to a jar file on the net
URL url = new URL("jar:http://hostname/my.jar!/");
// Create a URL that refers to a jar file in the file system
url = new URL("jar:file:/c:/almanac/my.jar!/");
// Get the jar file
JarURLConnection conn = (JarURLConnection)url.openConnection();
JarFile jarfile = conn.getJarFile();
String entryName = conn.getEntryName(); // null
// Create a URL that refers to an entry in the jar file
url = new URL("jar:file:/c:/almanac/my.jar!/com/mycompany/MyClass.class");
// Get the jar file
conn = (JarURLConnection)url.openConnection();
jarfile = conn.getJarFile();
// Get the entry name; it should be the same as specified on URL
entryName = conn.getEntryName();
// Get the jar entry
JarEntry jarEntry = conn.getJarEntry();
} catch (MalformedURLException e) {
} catch (IOException e) {
}
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -