@ -84,6 +84,8 @@ public class JarFile extends java.util.jar.JarFile {
private String comment ;
private volatile boolean closed ;
/ * *
* Create a new { @link JarFile } backed by the specified file .
* @param file the root jar file
@ -109,6 +111,7 @@ public class JarFile extends java.util.jar.JarFile {
* /
JarFile ( JarFile parent ) throws IOException {
super ( parent . rootFile . getFile ( ) ) ;
super . close ( ) ;
this . parent = parent ;
this . rootFile = parent . rootFile ;
this . pathFromRoot = parent . pathFromRoot ;
@ -140,6 +143,7 @@ public class JarFile extends java.util.jar.JarFile {
private JarFile ( JarFile parent , RandomAccessDataFile rootFile , String pathFromRoot , RandomAccessData data ,
JarEntryFilter filter , JarFileType type , Supplier < Manifest > manifestSupplier ) throws IOException {
super ( rootFile . getFile ( ) ) ;
super . close ( ) ;
this . parent = parent ;
this . rootFile = rootFile ;
this . pathFromRoot = pathFromRoot ;
@ -334,12 +338,19 @@ public class JarFile extends java.util.jar.JarFile {
@Override
public void close ( ) throws IOException {
super . close ( ) ;
if ( this . closed ) {
return ;
}
this . closed = true ;
if ( this . type = = JarFileType . DIRECT & & this . parent = = null ) {
this . rootFile . close ( ) ;
}
}
boolean isClosed ( ) {
return this . closed ;
}
String getUrlString ( ) throws MalformedURLException {
if ( this . urlString = = null ) {
this . urlString = getUrl ( ) . toString ( ) ;