Class UnZipStep
java.lang.Object
hudson.model.AbstractDescribableImpl<org.jenkinsci.plugins.workflow.steps.Step>
org.jenkinsci.plugins.workflow.steps.Step
org.jenkinsci.plugins.pipeline.utility.steps.AbstractFileStep
org.jenkinsci.plugins.pipeline.utility.steps.AbstractFileDecompressStep
org.jenkinsci.plugins.pipeline.utility.steps.zip.UnZipStep
- All Implemented Interfaces:
ExtensionPoint,Describable<org.jenkinsci.plugins.workflow.steps.Step>
Unzips a zip file.
Can also be used to test a zip file.
- Author:
- Robert Sandell <rsandell@cloudbees.com>.
-
Nested Class Summary
Nested ClassesNested classes/interfaces inherited from interface hudson.ExtensionPoint
ExtensionPoint.LegacyInstancesAreScopedToHudson -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionGet the charset to use when unzipping the zip file.The name/path of the zip file to extract.booleanisRead()Read the content of the files into a String instead of writing them to the workspace.voidsetCharset(String charset) Set the charset to use when unzipping the zip file.voidsetRead(boolean read) Read the content of the files into a String instead of writing them to the workspace.org.jenkinsci.plugins.workflow.steps.StepExecutionstart(org.jenkinsci.plugins.workflow.steps.StepContext context) Methods inherited from class org.jenkinsci.plugins.pipeline.utility.steps.AbstractFileDecompressStep
getDir, getGlob, isQuiet, isTest, setDir, setGlob, setQuiet, setTestMethods inherited from class org.jenkinsci.plugins.pipeline.utility.steps.AbstractFileStep
getFile, setFileMethods inherited from class org.jenkinsci.plugins.workflow.steps.Step
getDescriptor
-
Constructor Details
-
UnZipStep
- Throws:
Descriptor.FormException
-
-
Method Details
-
getZipFile
The name/path of the zip file to extract.- Returns:
- the path
-
isRead
public boolean isRead()Read the content of the files into a String instead of writing them to the workspace. E.g.String version = unzip zipFile: 'example.zip', glob: 'version.txt', read: true- Returns:
- if the content should be read to a string instead of written to the workspace
-
setRead
@DataBoundSetter public void setRead(boolean read) Read the content of the files into a String instead of writing them to the workspace. E.g.String version = unzip zipFile: 'example.zip', glob: 'version.txt', read: true- Parameters:
read- if the content should be read to a string instead of written to the workspace
-
getCharset
Get the charset to use when unzipping the zip file. E.g. UTF-8String version = unzip zipFile: 'example.zip', glob: 'version.txt', read: true, charset: UTF-8- Returns:
- String specifying the charset, defaults to UTF-8
-
setCharset
Set the charset to use when unzipping the zip file.String version = unzip zipFile: 'example.zip', glob: 'version.txt', read: true , charset: UTF-8- Parameters:
charset- the charset to use when unzipping, defaults to UTF-8
-
start
public org.jenkinsci.plugins.workflow.steps.StepExecution start(org.jenkinsci.plugins.workflow.steps.StepContext context) throws Exception - Specified by:
startin classorg.jenkinsci.plugins.workflow.steps.Step- Throws:
Exception
-