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>
public class UnZipStep extends AbstractFileDecompressStep
Unzips a zip file. Can also be used to test a zip file.- Author:
- Robert Sandell <rsandell@cloudbees.com>.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
UnZipStep.DescriptorImpl
-
Nested classes/interfaces inherited from interface hudson.ExtensionPoint
ExtensionPoint.LegacyInstancesAreScopedToHudson
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description String
getCharset()
Get the charset to use when unzipping the zip file.String
getZipFile()
The name/path of the zip file to extract.boolean
isRead()
Read the content of the files into a String instead of writing them to the workspace.void
setCharset(String charset)
Set the charset to use when unzipping the zip file.void
setRead(boolean read)
Read the content of the files into a String instead of writing them to the workspace.org.jenkinsci.plugins.workflow.steps.StepExecution
start(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, setTest
-
Methods inherited from class org.jenkinsci.plugins.pipeline.utility.steps.AbstractFileStep
getFile, setFile
-
-
-
-
Constructor Detail
-
UnZipStep
@DataBoundConstructor public UnZipStep(String zipFile) throws Descriptor.FormException
- Throws:
Descriptor.FormException
-
-
Method Detail
-
getZipFile
public String 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
public String 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
@DataBoundSetter public void setCharset(String charset)
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
-
-