< prev index next >

src/java.base/share/classes/java/net/JarURLConnection.java

Print this page
rev 56290 : 8230648: Replace @exception tag with @throws in java.base
Summary: Minor coding style update of javadoc tag in any file in java.base
Reviewed-by: prappo, lancea


 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      * @exception 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      * @exception 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      * @exception 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      * @exception IOException if getting the JAR entry causes an
 268      * IOException to be thrown.
 269      *
 270      * @see #getJarEntry
 271      */
 272     public Attributes getAttributes() throws IOException {
 273         JarEntry e = getJarEntry();
 274         return e != null ? e.getAttributes() : null;
 275     }
 276 
 277     /**
 278      * Returns the main Attributes for the JAR file for this
 279      * connection.
 280      *
 281      * @return the main Attributes for the JAR file for this
 282      * connection.
 283      *
 284      * @exception IOException if getting the manifest causes an
 285      * IOException to be thrown.
 286      *
 287      * @see #getJarFile
 288      * @see #getManifest
 289      */
 290     public Attributes getMainAttributes() throws IOException {
 291         Manifest man = getManifest();
 292         return man != null ? man.getMainAttributes() : null;
 293     }
 294 
 295     /**
 296      * Returns the Certificate objects for this connection if the URL
 297      * for it points to a JAR file entry, null otherwise. This method
 298      * can only be called once
 299      * the connection has been completely verified by reading
 300      * from the input stream until the end of the stream has been
 301      * reached. Otherwise, this method will return {@code null}
 302      *
 303      * @return the Certificate object for this connection if the URL
 304      * for it points to a JAR file entry, null otherwise.
 305      *
 306      * @exception IOException if getting the JAR entry causes an
 307      * IOException to be thrown.
 308      *
 309      * @see #getJarEntry
 310      */
 311     public java.security.cert.Certificate[] getCertificates()
 312          throws IOException
 313     {
 314         JarEntry e = getJarEntry();
 315         return e != null ? e.getCertificates() : null;
 316     }
 317 }


 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      */
 272     public Attributes getAttributes() throws IOException {
 273         JarEntry e = getJarEntry();
 274         return e != null ? e.getAttributes() : null;
 275     }
 276 
 277     /**
 278      * Returns the main Attributes for the JAR file for this
 279      * connection.
 280      *
 281      * @return the main Attributes for the JAR file for this
 282      * connection.
 283      *
 284      * @throws    IOException if getting the manifest causes an
 285      * IOException to be thrown.
 286      *
 287      * @see #getJarFile
 288      * @see #getManifest
 289      */
 290     public Attributes getMainAttributes() throws IOException {
 291         Manifest man = getManifest();
 292         return man != null ? man.getMainAttributes() : null;
 293     }
 294 
 295     /**
 296      * Returns the Certificate objects for this connection if the URL
 297      * for it points to a JAR file entry, null otherwise. This method
 298      * can only be called once
 299      * the connection has been completely verified by reading
 300      * from the input stream until the end of the stream has been
 301      * reached. Otherwise, this method will return {@code null}
 302      *
 303      * @return the Certificate object for this connection if the URL
 304      * for it points to a JAR file entry, null otherwise.
 305      *
 306      * @throws    IOException if getting the JAR entry causes an
 307      * IOException to be thrown.
 308      *
 309      * @see #getJarEntry
 310      */
 311     public java.security.cert.Certificate[] getCertificates()
 312          throws IOException
 313     {
 314         JarEntry e = getJarEntry();
 315         return e != null ? e.getCertificates() : null;
 316     }
 317 }
< prev index next >