com.taleo.integration.client.customstep.compress
Class ZipPostStep

java.lang.Object
  extended by com.taleo.integration.client.step.BaseStep
      extended by com.taleo.integration.client.step.BaseCustomStep
          extended by com.taleo.integration.client.customstep.BaseCustomStep
              extended by com.taleo.integration.client.customstep.compress.ZipPostStep
All Implemented Interfaces:
com.taleo.integration.client.step.CustomStep, com.taleo.integration.client.step.Step

public class ZipPostStep
extends BaseCustomStep

Post-processing step to zip the current workflow file or other files corresponding to a pattern.

This step takes all parameters from its base class BaseCustomStep and the following additional parameters:

This class is dependent on:

Here are two examples of how to define this custom step in the TCC configuration file:


Author:
Romain Guay, Taleo Corporation
See Also:
java.util.zip

Field Summary
protected  int method
          The compression method.
 int METHOD_DEFLATED
          The compression methods.
 int METHOD_STORED
           
 
Fields inherited from class com.taleo.integration.client.customstep.BaseCustomStep
parameterNames
 
Fields inherited from class com.taleo.integration.client.step.BaseCustomStep
parameters
 
Fields inherited from class com.taleo.integration.client.step.BaseStep
commType, ERROR_NULL_GLOBAL_CONFIG, ERROR_NULL_PIPELINE, ERROR_NULL_STEP_CONFIG, productCode, tempFolder, type, version
 
Constructor Summary
ZipPostStep()
          Constructor without arguments.
 
Method Summary
 void execute(com.taleo.ws.integration.client.Pipeline pipeline)
           
 java.lang.String getDescription()
           
 java.lang.String getFilePattern()
          Get the file pattern.
 java.lang.String getIdentifier()
           
 int getMethod()
          Get the compression method.
 java.lang.String getName()
           
 java.lang.String getOutputFile()
          Get the output file.
 com.taleo.ws.integration.client.SupportedPipeline getSupportedPipeline()
           
 void init(com.taleo.ws.integration.client.GlobalConfig config)
           
 boolean isDeleteOriginal()
          Get the delete original flag.
 void setDeleteOriginal(boolean deleteOriginal)
          Set the delete original flag.
 void setFilePattern(java.lang.String filePattern)
          Set the file pattern.
 void setMethod(int method)
          Set the compression method (METHOD_DEFLATED or METHOD_STORED).
 void setOutputFile(java.lang.String outputFile)
          Set the output file.
protected  void zip(java.io.File pattern, java.io.File zipFile, boolean deleteOriginal)
          Zip the files matching the file pattern into the given zip file.
protected  void zip(java.io.File file, java.io.File base, java.util.zip.ZipOutputStream os)
          Zip a file or folder in the given output stream.
 
Methods inherited from class com.taleo.integration.client.customstep.BaseCustomStep
createTempFile, createTempFile, getEncoding, getTempFolder, isActive, registerParameterName, setActive, setEncoding, validateParameterNames
 
Methods inherited from class com.taleo.integration.client.step.BaseCustomStep
getType, init
 
Methods inherited from class com.taleo.integration.client.step.BaseStep
getAllProcessSupportPipeline, getCurrentFile, getCurrentFile, getCurrentMessage, getPostProcessSupportPipeline, getPreProcessSupportPipeline, isOriginalFile, validateLastStepType, validateMessageType, validatePipeline
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface com.taleo.integration.client.step.Step
validatePipeline
 

Field Detail

METHOD_DEFLATED

public final int METHOD_DEFLATED
The compression methods.

See Also:
Constant Field Values

METHOD_STORED

public final int METHOD_STORED
See Also:
Constant Field Values

method

protected int method
The compression method.

Constructor Detail

ZipPostStep

public ZipPostStep()
Constructor without arguments.

Method Detail

getFilePattern

public java.lang.String getFilePattern()
Get the file pattern.

Returns:

setFilePattern

public void setFilePattern(java.lang.String filePattern)
Set the file pattern.

Parameters:
filePattern -

getOutputFile

public java.lang.String getOutputFile()
Get the output file.

Returns:

setOutputFile

public void setOutputFile(java.lang.String outputFile)
Set the output file.

Parameters:
outputFile -

getMethod

public int getMethod()
Get the compression method.

Returns:

setMethod

public void setMethod(int method)
Set the compression method (METHOD_DEFLATED or METHOD_STORED).

Parameters:
method -

isDeleteOriginal

public boolean isDeleteOriginal()
Get the delete original flag.

Returns:

setDeleteOriginal

public void setDeleteOriginal(boolean deleteOriginal)
Set the delete original flag.

Parameters:
deleteOriginal -

getIdentifier

public java.lang.String getIdentifier()
Specified by:
getIdentifier in interface com.taleo.integration.client.step.CustomStep
Specified by:
getIdentifier in interface com.taleo.integration.client.step.Step
Specified by:
getIdentifier in class com.taleo.integration.client.step.BaseCustomStep

getDescription

public java.lang.String getDescription()
Specified by:
getDescription in interface com.taleo.integration.client.step.CustomStep
Specified by:
getDescription in interface com.taleo.integration.client.step.Step
Specified by:
getDescription in class com.taleo.integration.client.step.BaseCustomStep

getName

public java.lang.String getName()
Specified by:
getName in interface com.taleo.integration.client.step.CustomStep
Specified by:
getName in interface com.taleo.integration.client.step.Step
Specified by:
getName in class com.taleo.integration.client.step.BaseCustomStep

getSupportedPipeline

public com.taleo.ws.integration.client.SupportedPipeline getSupportedPipeline()
Specified by:
getSupportedPipeline in interface com.taleo.integration.client.step.Step
Overrides:
getSupportedPipeline in class com.taleo.integration.client.step.BaseCustomStep

init

public void init(com.taleo.ws.integration.client.GlobalConfig config)
Overrides:
init in class BaseCustomStep

execute

public void execute(com.taleo.ws.integration.client.Pipeline pipeline)
             throws com.taleo.integration.client.step.StepException
Throws:
com.taleo.integration.client.step.StepException

zip

protected void zip(java.io.File pattern,
                   java.io.File zipFile,
                   boolean deleteOriginal)
            throws java.io.IOException
Zip the files matching the file pattern into the given zip file.

Parameters:
pattern - The file pattern to select folder or files.
zipFile - The resulting zip file.
deleteOriginal - Delete the original files after compression.
Throws:
java.io.IOException

zip

protected void zip(java.io.File file,
                   java.io.File base,
                   java.util.zip.ZipOutputStream os)
            throws java.io.IOException
Zip a file or folder in the given output stream.

Parameters:
file - The file or folder name.
base - Base file to relativize filenames in the Zip.
os - The output stream.
Throws:
java.io.IOException