Package se.ikama.bauta.batch.tasklet
Class ZipDirectoryTasklet
- java.lang.Object
-
- se.ikama.bauta.batch.tasklet.ZipDirectoryTasklet
-
- All Implemented Interfaces:
org.springframework.batch.core.step.tasklet.Tasklet
public class ZipDirectoryTasklet extends java.lang.Object implements org.springframework.batch.core.step.tasklet.TaskletCompresses the given directory into a zip-file.
-
-
Constructor Summary
Constructors Constructor Description ZipDirectoryTasklet()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description org.springframework.batch.repeat.RepeatStatusexecute(org.springframework.batch.core.StepContribution contribution, org.springframework.batch.core.scope.context.ChunkContext chunkContext)static voidpack(org.springframework.core.io.FileSystemResource sourceDirPath, org.springframework.core.io.FileSystemResource zipFilePath)voidsetDestFile(org.springframework.core.io.FileSystemResource destFile)voidsetSourceDir(org.springframework.core.io.FileSystemResource sourceDir)
-
-
-
Method Detail
-
execute
public org.springframework.batch.repeat.RepeatStatus execute(org.springframework.batch.core.StepContribution contribution, org.springframework.batch.core.scope.context.ChunkContext chunkContext) throws java.lang.Exception- Specified by:
executein interfaceorg.springframework.batch.core.step.tasklet.Tasklet- Throws:
java.lang.Exception
-
pack
public static void pack(org.springframework.core.io.FileSystemResource sourceDirPath, org.springframework.core.io.FileSystemResource zipFilePath) throws java.io.IOException- Throws:
java.io.IOException
-
setSourceDir
public void setSourceDir(org.springframework.core.io.FileSystemResource sourceDir)
- Parameters:
sourceDir- The directory to be zipped
-
setDestFile
public void setDestFile(org.springframework.core.io.FileSystemResource destFile)
- Parameters:
destFile- Destination zip file
-
-