Package org.zeroturnaround.zip
Class FileSource
java.lang.Object
org.zeroturnaround.zip.FileSource
- All Implemented Interfaces:
ZipEntrySource
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptiongetEntry()
getPath()
static FileSource[]
Creates a sequence of FileSource objects via mapping a sequence of files to the sequence of corresponding names for the entriestoString()
-
Field Details
-
path
-
file
-
-
Constructor Details
-
FileSource
-
-
Method Details
-
getPath
- Specified by:
getPath
in interfaceZipEntrySource
- Returns:
- path of the given entry (not
null
).
-
getEntry
- Specified by:
getEntry
in interfaceZipEntrySource
- Returns:
- meta-data of the given entry (not
null
).
-
getInputStream
- Specified by:
getInputStream
in interfaceZipEntrySource
- Returns:
- an input stream of the given entry
or
null
if this entry is a directory. - Throws:
IOException
- can throw getting the InputStream
-
toString
-
pair
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 arraynames
- 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:
IllegalArgumentException
- if the names array contains less items than the files array
-