java.lang.Object
hudson.model.AbstractDescribableImpl<org.jenkinsci.plugins.workflow.steps.Step>
org.jenkinsci.plugins.workflow.steps.Step
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>.
  • Constructor Details

  • Method Details

    • 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-8 String 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
    • start

      public org.jenkinsci.plugins.workflow.steps.StepExecution start(org.jenkinsci.plugins.workflow.steps.StepContext context) throws Exception
      Specified by:
      start in class org.jenkinsci.plugins.workflow.steps.Step
      Throws:
      Exception