JarURLConnection class in Java

java.net.JarURLConnection

A URL Connection to a Java ARchive (JAR) file or an entry in a JAR file.

The syntax of a JAR URL is: jar:<url>!/{entry}

JarURLConnection instances can only be used to read from JAR files. It is not possible to get a java.io.OutputStream to modify or write to the underlying JAR file using this class.

Some methods of JarURLConnection class

getAttributes(): This method returns the Attributes object for this connection if its URL points to a JAR file entry, null otherwise.

getCertificates(): This method returns the Certificate objects for this connection if the URL for it points to a JAR file entry, null otherwise.

getEntryName(): This method returns the entry name for this connection.

getJarEntry(): This method returns the JAR entry object for this connection if any. 

getJarFile(): This method returns the JAR file for this connection.

getJarFileURL(): This method returns the URL for the Jar file for this connection.

getMainAttributes(): This method returns the main Attributes for the JAR file for this connection.

getManifest(): This method returns the Manifest for this connection, or null if none.

No comments:

Post a Comment