< prev index next >

src/jdk.jlink/share/classes/jdk/tools/jlink/internal/Archive.java

Print this page
@@ -22,21 +22,22 @@
   * or visit www.oracle.com if you need additional information or have any
   * questions.
   */
  package jdk.tools.jlink.internal;
  
+ import java.io.Closeable;
  import java.io.IOException;
  import java.io.InputStream;
  import java.nio.file.Path;
  import java.util.Objects;
  import java.util.stream.Stream;
  
  /**
   * An Archive of all content, classes, resources, configuration files, and
   * other, for a module.
   */
- public interface Archive {
+ public interface Archive extends Closeable {
  
      /**
       * Entry is contained in an Archive
       */
      public abstract class Entry {

@@ -57,27 +58,24 @@
          private final EntryType type;
          private final Archive archive;
          private final String path;
  
          /**
-          * Constructs an entry of the given archive
-          * @param archive archive
-          * @param path
-          * @param name an entry name that does not contain the module name
-          * @param type
+          * Constructs an entry of the given archive.
+          *
+          * @param archive the archive in which this entry exists.
+          * @param path the complete path of the entry, including the module.
+          * @param name an entry name relative to its containing module.
+          * @param type the entry type.
           */
          public Entry(Archive archive, String path, String name, EntryType type) {
              this.archive = Objects.requireNonNull(archive);
              this.path = Objects.requireNonNull(path);
              this.name = Objects.requireNonNull(name);
              this.type = Objects.requireNonNull(type);
          }
  
-         public final Archive archive() {
-             return archive;
-         }
- 
          public final EntryType type() {
              return type;
          }
  
          /**

@@ -132,7 +130,8 @@
      void open() throws IOException;
  
      /*
       * Close the archive
       */
+     @Override
      void close() throws IOException;
  }
< prev index next >