198 public URL getJarFileURL() { 199 return jarFileURL; 200 } 201 202 /** 203 * Return the entry name for this connection. This method 204 * returns null if the JAR file URL corresponding to this 205 * connection points to a JAR file and not a JAR file entry. 206 * 207 * @return the entry name for this connection, if any. 208 */ 209 public String getEntryName() { 210 return entryName; 211 } 212 213 /** 214 * Return the JAR file for this connection. 215 * 216 * @return the JAR file for this connection. If the connection is 217 * a connection to an entry of a JAR file, the JAR file object is 218 * returned 219 * 220 * @throws IOException if an IOException occurs while trying to 221 * connect to the JAR file for this connection. 222 * 223 * @see #connect 224 */ 225 public abstract JarFile getJarFile() throws IOException; 226 227 /** 228 * Returns the Manifest for this connection, or null if none. 229 * 230 * @return the manifest object corresponding to the JAR file object 231 * for this connection. 232 * 233 * @throws IOException if getting the JAR file for this 234 * connection causes an IOException to be thrown. 235 * 236 * @see #getJarFile 237 */ 238 public Manifest getManifest() throws IOException { 239 return getJarFile().getManifest(); 240 } 241 242 /** 243 * Return the JAR entry object for this connection, if any. This 244 * method returns null if the JAR file URL corresponding to this 245 * connection points to a JAR file and not a JAR file entry. 246 * 247 * @return the JAR entry object for this connection, or null if 248 * the JAR URL for this connection points to a JAR file. 249 * 250 * @throws IOException if getting the JAR file for this 251 * connection causes an IOException to be thrown. 252 * 253 * @see #getJarFile 254 * @see #getJarEntry 255 */ 256 public JarEntry getJarEntry() throws IOException { 257 return entryName == null ? null : getJarFile().getJarEntry(entryName); 258 } 259 260 /** 261 * Return the Attributes object for this connection if the URL 262 * for it points to a JAR file entry, null otherwise. 263 * 264 * @return the Attributes object for this connection if the URL 265 * for it points to a JAR file entry, null otherwise. 266 * 267 * @throws IOException if getting the JAR entry causes an 268 * IOException to be thrown. 269 * 270 * @see #getJarEntry 271 */ | 198 public URL getJarFileURL() { 199 return jarFileURL; 200 } 201 202 /** 203 * Return the entry name for this connection. This method 204 * returns null if the JAR file URL corresponding to this 205 * connection points to a JAR file and not a JAR file entry. 206 * 207 * @return the entry name for this connection, if any. 208 */ 209 public String getEntryName() { 210 return entryName; 211 } 212 213 /** 214 * Return the JAR file for this connection. 215 * 216 * @return the JAR file for this connection. If the connection is 217 * a connection to an entry of a JAR file, the JAR file object is 218 * returned. The JAR file is also returned if the connection to 219 * a JAR file entry fails, but the JAR file itself is accessible. 220 * 221 * @throws IOException if an IOException occurs while trying to 222 * connect to the JAR file for this connection. 223 * 224 * @see #connect 225 */ 226 public abstract JarFile getJarFile() throws IOException; 227 228 /** 229 * Returns the Manifest for this connection, or null if none. 230 * 231 * @return the manifest object corresponding to the JAR file object 232 * for this connection. If the connection is a connection to an 233 * entry of a JAR file, the manifest object is also returned if the 234 * connection to a JAR file entry fails, but the JAR file itself is 235 * accessible. 236 * 237 * @throws IOException if getting the JAR file for this 238 * connection causes an IOException to be thrown. 239 * 240 * @see #getJarFile 241 */ 242 public Manifest getManifest() throws IOException { 243 return getJarFile().getManifest(); 244 } 245 246 /** 247 * Return the JAR entry object for this connection, if any. This 248 * method returns null if the JAR file URL corresponding to this 249 * connection points to a JAR file and not a JAR file entry. 250 * 251 * @return the JAR entry object for this connection, or null if 252 * the JAR URL for this connection points to a JAR file. 253 * 254 * @throws IOException if getting the JAR file for this 255 * connection causes an IOException to be thrown, or if the 256 * connection to a JAR file entry fails. 257 * 258 * @see #getJarFile 259 * @see #getJarEntry 260 */ 261 public JarEntry getJarEntry() throws IOException { 262 return entryName == null ? null : getJarFile().getJarEntry(entryName); 263 } 264 265 /** 266 * Return the Attributes object for this connection if the URL 267 * for it points to a JAR file entry, null otherwise. 268 * 269 * @return the Attributes object for this connection if the URL 270 * for it points to a JAR file entry, null otherwise. 271 * 272 * @throws IOException if getting the JAR entry causes an 273 * IOException to be thrown. 274 * 275 * @see #getJarEntry 276 */ |