Class ResourceAssertTasklet

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

    public class ResourceAssertTasklet
    extends java.lang.Object
    implements org.springframework.batch.core.step.tasklet.Tasklet
    Asserts that a given directory (file/directory) exists.
    • 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 setAssertionMessage​(java.lang.String assertionMessage)  
      void setExpectedFileCount​(java.lang.Integer expectedFileCount)  
      void setResource​(org.springframework.core.io.Resource resource)  
      • Methods inherited from class java.lang.Object

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

      • ResourceAssertTasklet

        public ResourceAssertTasklet()
    • 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
      • setResource

        public void setResource​(org.springframework.core.io.Resource resource)
        Parameters:
        resource - The directory to be checked.
      • setAssertionMessage

        public void setAssertionMessage​(java.lang.String assertionMessage)
        Parameters:
        assertionMessage - An optional message to be presented if assertion fails.
      • setExpectedFileCount

        public void setExpectedFileCount​(java.lang.Integer expectedFileCount)
        Parameters:
        expectedFileCount - The expected amount of files in the provided directory. Optional.