|
Java プラットフォーム 1.2 |
|||||||||
| 前のクラス 次のクラス | フレームあり フレームなし | |||||||||
| 概要: 内部クラス | フィールド | コンストラクタ | メソッド | 詳細: フィールド | コンストラクタ | メソッド | |||||||||
java.lang.Object
|
+--java.net.URLConnection
|
+--java.net.JarURLConnection
JAR (Java ARchive) ファイル、または JAR ファイル内にあるエントリへの URL 接続です。
JAR URL の構文は、次のとおりです。
jar:<url>!/{entry}
たとえば、次のようになります。
jar:http://www.foo.com/bar/baz.jar!/COM/foo/Quux.class
Jar URL は、単一の JAR エントリあるいは基底 URL への参照、あるいはコードベースとしての JAR ファイル、または相対 URL への参照のどちらにも使えます。上記に示した例は完全な JAR URL であり、JAR エントリを参照しています。エントリ名が省略された場合、URL は JAR ファイルの全体を参照します。
jar:http://www.foo.com/bar/baz.jar!/
JAR URL を作成するのが明白な場合、JAR 特有の機能が必要なときは、汎用 URLConnection を JarURLConnection にキャストしてください。次に例を示します。
URL url = new URL("jar:file:/home/duke/duke.jar!/");
JarURLConnection jarConnection = (JarURLConnection)url.openConnection();
Manifest manifest = jarConnection.getManifest();
例:
jar:http://www.foo.com/bar/baz.jar!/COM/foo/Quux.class
jar:http://www.foo.com/bar/baz.jar!/
jar:http://www.foo.com/bar/baz.jar!/COM/foo/
!/ は、区切り文字です。
JAR url の作成では、以下の規則が適用されます。
例:
URL,
URLConnection,
JarFile,
JarInputStream,
Manifest,
ZipEntry| フィールドの概要 | |
protected URLConnection |
jarFileURLConnection
接続が開始された場合の、JAR ファイル URL への接続です。 |
| クラス java.net.URLConnection から継承したフィールド |
allowUserInteraction,
connected,
doInput,
doOutput,
ifModifiedSince,
url,
useCaches |
| コンストラクタの概要 | |
protected |
JarURLConnection(URL url)
|
| メソッドの概要 | |
Attributes |
getAttributes()
接続で使う URL が JAR ファイルエントリを指す場合、この接続用の Attributes オブジェクトを返します。 |
Certificate[] |
getCertificates()
接続で使う URL が JAR ファイルエントリを指す場合に、この接続用の Certificate オブジェクトを返します。 |
String |
getEntryName()
この接続で使うエントリ名を返します。 |
JarEntry |
getJarEntry()
この接続で使う JAR エントリオブジェクトがあれば、それを返します。 |
abstract JarFile |
getJarFile()
この接続で使う JAR ファイルを返します。 |
URL |
getJarFileURL()
この接続で使う JAR ファイルの URL を返します。 |
Attributes |
getMainAttributes()
この接続で使う JAR ファイルの主要な Attributes を返します。 |
Manifest |
getManifest()
この接続で使うマニフェストがあればそれを返し、なければ null を返します。 |
| クラス java.lang.Object から継承したメソッド |
clone,
equals,
finalize,
getClass,
hashCode,
notify,
notifyAll,
wait,
wait,
wait |
| フィールドの詳細 |
protected URLConnection jarFileURLConnection
| コンストラクタの詳細 |
protected JarURLConnection(URL url)
throws MalformedURLException
| メソッドの詳細 |
public URL getJarFileURL()
public String getEntryName()
public abstract JarFile getJarFile()
throws IOException
URLConnection.connect()
public Manifest getManifest()
throws IOException
getJarFile()
public JarEntry getJarEntry()
throws IOException
getJarFile(),
getJarEntry()
public Attributes getAttributes()
throws IOException
getJarEntry()
public Attributes getMainAttributes()
throws IOException
getJarFile(),
getManifest()
public Certificate[] getCertificates()
throws IOException
null を返します。getJarEntry()
|
Java プラットフォーム 1.2 |
|||||||||
| 前のクラス 次のクラス | フレームあり フレームなし | |||||||||
| 概要: 内部クラス | フィールド | コンストラクタ | メソッド | 詳細: フィールド | コンストラクタ | メソッド | |||||||||