Package org.ow2.clif.jenkins.jobs
Class Zip
java.lang.Object
org.ow2.clif.jenkins.jobs.Zip
-
Constructor Summary
Constructors -
Method Summary
-
Constructor Details
-
Zip
-
Zip
-
-
Method Details
-
getFile
-
id
-
sanitize
Protection against malicious zip entries that could contain .. path elements or possibly an absolute path. An absolute path is turned relative by discarding the root element. Then the path is normalized (discard . and resolve .. path elements). Finally, all occurrences of .. path elements are merely discarded.- Parameters:
entry- a path- Returns:
- a sanitized version of the given path
-
entries
returns entry names of zip, matching given pattern if provided- Parameters:
pattern- a Java regular expression as a string- Returns:
- the list of entries matching the given pattern
- Throws:
IOException- the zip archive could not be correctly unzipped
-
entries
syntactic sugar for all entries (entries(null))- Returns:
- all zip entries as a list
- Throws:
IOException- the zip archive could not be correctly unzipped
-
basedir
- Returns:
- the first entry name if directory, or empty string otherwise
- Throws:
IOException- the zip archive could not be correctly unzipped
-
extractTo
- Throws:
IOException
-
extractTo
unzips to directory- Parameters:
dir- the target directory- Returns:
- this Zip object
- Throws:
IOException- the zip archive could not be correctly unzipped
-
delete
-