Package aQute.lib.zip

Class JarIndex

  • All Implemented Interfaces:
    java.lang.Iterable<NamedNode>

    public class JarIndex
    extends Hierarchy
    Creates a Hierarchy on a ZipFile, a directory, or a ZipStream.
    • Nested Class Summary

      Nested Classes 
      Modifier and Type Class Description
      static interface  JarIndex.NodeInfo  
    • Field Summary

      Fields 
      Modifier and Type Field Description
      private static java.util.regex.Pattern PATH_SPLITTER  
    • Constructor Summary

      Constructors 
      Constructor Description
      JarIndex​(java.io.File in)  
      JarIndex​(java.io.File in, java.util.regex.Pattern doNotCopy)  
      JarIndex​(java.io.InputStream in)  
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      private static void addFile​(java.util.Map<java.lang.String,​java.lang.Object> map, java.lang.String[] parts, int i, java.lang.String path, java.lang.Object payload)  
      private static void addFile​(java.util.Map<java.lang.String,​java.lang.Object> map, java.lang.String path, java.lang.Object payload)  
      private static java.util.Map<java.lang.String,​java.lang.Object> build​(java.io.File file, java.util.regex.Pattern doNotCopy, java.util.function.Function<JarIndex.NodeInfo,​?> f)  
      private static java.util.Map<java.lang.String,​java.lang.Object> buildFromDirectory​(java.nio.file.Path baseDir, java.util.regex.Pattern doNotCopy, java.util.function.Function<JarIndex.NodeInfo,​?> f)  
      private static java.util.Map<java.lang.String,​java.lang.Object> buildFromInputStream​(java.io.InputStream in, java.util.function.Function<JarIndex.NodeInfo,​?> f)  
      private static java.util.Map<java.lang.String,​java.lang.Object> buildFromZip​(java.io.File file, java.util.function.Function<JarIndex.NodeInfo,​?> f)  
      private static JarIndex.NodeInfo getNodeInfo​(java.io.File in)  
      private static JarIndex.NodeInfo getNodeInfo​(java.util.zip.ZipEntry entry, SupplierWithException<java.io.InputStream> open)  
      private static java.lang.Object getPayload​(java.util.function.Function<JarIndex.NodeInfo,​?> f, JarIndex.NodeInfo nodeInfo)  
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
      • Methods inherited from interface java.lang.Iterable

        forEach, spliterator
    • Field Detail

      • PATH_SPLITTER

        private static final java.util.regex.Pattern PATH_SPLITTER
    • Constructor Detail

      • JarIndex

        public JarIndex​(java.io.InputStream in)
                 throws java.io.IOException
        Throws:
        java.io.IOException
      • JarIndex

        public JarIndex​(java.io.File in)
                 throws java.io.IOException
        Throws:
        java.io.IOException
      • JarIndex

        public JarIndex​(java.io.File in,
                        java.util.regex.Pattern doNotCopy)
                 throws java.io.IOException
        Throws:
        java.io.IOException
    • Method Detail

      • build

        private static java.util.Map<java.lang.String,​java.lang.Object> build​(java.io.File file,
                                                                                    java.util.regex.Pattern doNotCopy,
                                                                                    java.util.function.Function<JarIndex.NodeInfo,​?> f)
                                                                             throws java.io.IOException
        Throws:
        java.io.IOException
      • buildFromDirectory

        private static java.util.Map<java.lang.String,​java.lang.Object> buildFromDirectory​(java.nio.file.Path baseDir,
                                                                                                 java.util.regex.Pattern doNotCopy,
                                                                                                 java.util.function.Function<JarIndex.NodeInfo,​?> f)
                                                                                          throws java.io.IOException
        Throws:
        java.io.IOException
      • buildFromZip

        private static java.util.Map<java.lang.String,​java.lang.Object> buildFromZip​(java.io.File file,
                                                                                           java.util.function.Function<JarIndex.NodeInfo,​?> f)
                                                                                    throws java.io.IOException
        Throws:
        java.io.IOException
      • buildFromInputStream

        private static java.util.Map<java.lang.String,​java.lang.Object> buildFromInputStream​(java.io.InputStream in,
                                                                                                   java.util.function.Function<JarIndex.NodeInfo,​?> f)
                                                                                            throws java.io.IOException
        Throws:
        java.io.IOException
      • addFile

        private static void addFile​(java.util.Map<java.lang.String,​java.lang.Object> map,
                                    java.lang.String path,
                                    java.lang.Object payload)
      • addFile

        private static void addFile​(java.util.Map<java.lang.String,​java.lang.Object> map,
                                    java.lang.String[] parts,
                                    int i,
                                    java.lang.String path,
                                    java.lang.Object payload)