Class FileSource

    • Field Summary

      Fields 
      Modifier and Type Field Description
      private java.io.File file  
      private java.lang.String path  
    • Constructor Summary

      Constructors 
      Constructor Description
      FileSource​(java.lang.String path, java.io.File file)  
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      java.util.zip.ZipEntry getEntry()  
      java.io.InputStream getInputStream()  
      java.lang.String getPath()  
      static FileSource[] pair​(java.io.File[] files, java.lang.String[] names)
      Creates a sequence of FileSource objects via mapping a sequence of files to the sequence of corresponding names for the entries
      java.lang.String toString()  
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
    • Field Detail

      • path

        private final java.lang.String path
      • file

        private final java.io.File file
    • Constructor Detail

      • FileSource

        public FileSource​(java.lang.String path,
                          java.io.File file)
    • Method Detail

      • getPath

        public java.lang.String getPath()
        Specified by:
        getPath in interface ZipEntrySource
        Returns:
        path of the given entry (not null).
      • getEntry

        public java.util.zip.ZipEntry getEntry()
        Specified by:
        getEntry in interface ZipEntrySource
        Returns:
        meta-data of the given entry (not null).
      • getInputStream

        public java.io.InputStream getInputStream()
                                           throws java.io.IOException
        Specified by:
        getInputStream in interface ZipEntrySource
        Returns:
        an input stream of the given entry or null if this entry is a directory.
        Throws:
        java.io.IOException - can throw getting the InputStream
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object
      • pair

        public static FileSource[] pair​(java.io.File[] files,
                                        java.lang.String[] names)
        Creates a sequence of FileSource objects via mapping a sequence of files to the sequence of corresponding names for the entries
        Parameters:
        files - file array to form the data of the objects in the resulting array
        names - file array to form the names of the objects in the resulting array
        Returns:
        array of FileSource objects created by mapping given files array to the given names array one by one
        Throws:
        java.lang.IllegalArgumentException - if the names array contains less items than the files array