Class CleanDirectoryTasklet

  • All Implemented Interfaces:
    org.springframework.batch.core.step.tasklet.Tasklet

    public class CleanDirectoryTasklet
    extends java.lang.Object
    implements org.springframework.batch.core.step.tasklet.Tasklet
    Deletes all files in the given directory.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      org.springframework.batch.repeat.RepeatStatus execute​(org.springframework.batch.core.StepContribution contribution, org.springframework.batch.core.scope.context.ChunkContext chunkContext)  
      void setDirectory​(org.springframework.core.io.FileSystemResource directory)  
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • CleanDirectoryTasklet

        public CleanDirectoryTasklet()
    • 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:
        execute in interface org.springframework.batch.core.step.tasklet.Tasklet
        Throws:
        java.lang.Exception
      • setDirectory

        public void setDirectory​(org.springframework.core.io.FileSystemResource directory)
        Parameters:
        directory - The directory to clean