src/java.base/share/classes/java/net/JarURLConnection.java
branchdatagramsocketimpl-branch
changeset 58678 9cf78a70fa4f
parent 54068 b067bd7edc26
child 58679 9c3209ff7550
equal deleted inserted replaced
58677:13588c901957 58678:9cf78a70fa4f
   215      *
   215      *
   216      * @return the JAR file for this connection. If the connection is
   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
   217      * a connection to an entry of a JAR file, the JAR file object is
   218      * returned
   218      * returned
   219      *
   219      *
   220      * @exception IOException if an IOException occurs while trying to
   220      * @throws    IOException if an IOException occurs while trying to
   221      * connect to the JAR file for this connection.
   221      * connect to the JAR file for this connection.
   222      *
   222      *
   223      * @see #connect
   223      * @see #connect
   224      */
   224      */
   225     public abstract JarFile getJarFile() throws IOException;
   225     public abstract JarFile getJarFile() throws IOException;
   228      * Returns the Manifest for this connection, or null if none.
   228      * Returns the Manifest for this connection, or null if none.
   229      *
   229      *
   230      * @return the manifest object corresponding to the JAR file object
   230      * @return the manifest object corresponding to the JAR file object
   231      * for this connection.
   231      * for this connection.
   232      *
   232      *
   233      * @exception IOException if getting the JAR file for this
   233      * @throws    IOException if getting the JAR file for this
   234      * connection causes an IOException to be thrown.
   234      * connection causes an IOException to be thrown.
   235      *
   235      *
   236      * @see #getJarFile
   236      * @see #getJarFile
   237      */
   237      */
   238     public Manifest getManifest() throws IOException {
   238     public Manifest getManifest() throws IOException {
   245      * connection points to a JAR file and not a JAR file entry.
   245      * connection points to a JAR file and not a JAR file entry.
   246      *
   246      *
   247      * @return the JAR entry object for this connection, or null if
   247      * @return the JAR entry object for this connection, or null if
   248      * the JAR URL for this connection points to a JAR file.
   248      * the JAR URL for this connection points to a JAR file.
   249      *
   249      *
   250      * @exception IOException if getting the JAR file for this
   250      * @throws    IOException if getting the JAR file for this
   251      * connection causes an IOException to be thrown.
   251      * connection causes an IOException to be thrown.
   252      *
   252      *
   253      * @see #getJarFile
   253      * @see #getJarFile
   254      * @see #getJarEntry
   254      * @see #getJarEntry
   255      */
   255      */
   256     public JarEntry getJarEntry() throws IOException {
   256     public JarEntry getJarEntry() throws IOException {
   257         return getJarFile().getJarEntry(entryName);
   257         return entryName == null ? null : getJarFile().getJarEntry(entryName);
   258     }
   258     }
   259 
   259 
   260     /**
   260     /**
   261      * Return the Attributes object for this connection if the URL
   261      * Return the Attributes object for this connection if the URL
   262      * for it points to a JAR file entry, null otherwise.
   262      * for it points to a JAR file entry, null otherwise.
   263      *
   263      *
   264      * @return the Attributes object for this connection if the URL
   264      * @return the Attributes object for this connection if the URL
   265      * for it points to a JAR file entry, null otherwise.
   265      * for it points to a JAR file entry, null otherwise.
   266      *
   266      *
   267      * @exception IOException if getting the JAR entry causes an
   267      * @throws    IOException if getting the JAR entry causes an
   268      * IOException to be thrown.
   268      * IOException to be thrown.
   269      *
   269      *
   270      * @see #getJarEntry
   270      * @see #getJarEntry
   271      */
   271      */
   272     public Attributes getAttributes() throws IOException {
   272     public Attributes getAttributes() throws IOException {
   279      * connection.
   279      * connection.
   280      *
   280      *
   281      * @return the main Attributes for the JAR file for this
   281      * @return the main Attributes for the JAR file for this
   282      * connection.
   282      * connection.
   283      *
   283      *
   284      * @exception IOException if getting the manifest causes an
   284      * @throws    IOException if getting the manifest causes an
   285      * IOException to be thrown.
   285      * IOException to be thrown.
   286      *
   286      *
   287      * @see #getJarFile
   287      * @see #getJarFile
   288      * @see #getManifest
   288      * @see #getManifest
   289      */
   289      */
   301      * reached. Otherwise, this method will return {@code null}
   301      * reached. Otherwise, this method will return {@code null}
   302      *
   302      *
   303      * @return the Certificate object for this connection if the URL
   303      * @return the Certificate object for this connection if the URL
   304      * for it points to a JAR file entry, null otherwise.
   304      * for it points to a JAR file entry, null otherwise.
   305      *
   305      *
   306      * @exception IOException if getting the JAR entry causes an
   306      * @throws    IOException if getting the JAR entry causes an
   307      * IOException to be thrown.
   307      * IOException to be thrown.
   308      *
   308      *
   309      * @see #getJarEntry
   309      * @see #getJarEntry
   310      */
   310      */
   311     public java.security.cert.Certificate[] getCertificates()
   311     public java.security.cert.Certificate[] getCertificates()