Results 1 to 2 of 2

Thread: Unable to delete file created in one Tasklet

  1. #1
    Join Date
    Jul 2009
    Location
    London, UK
    Posts
    47

    Default Unable to delete file created in one Tasklet

    Hello,

    we are facing a what seems to be file lock issue:
    We have defined a Tasklet where we create a new file by copying another one from a remote location(apologies for the hypothetical tags but you get the point.. ):
    Code:
    <step1>
    <tasklet>
       public RepeatStatus execute(StepContribution stepContribution, ChunkContext chunkContext){
      ................
      FileUtils.copyFileToDirectory(remoteZipFile, zipFileLocalCopyDirectory, true);
      ................
    }
    </tasklet>
    </step1>
    and then a final Tasklet which attempts to delete that file:
    Code:
    <step2>
    <tasklet>
      .................
      FileUtils.cleanDirectory(zipFileLocalCopyDirectoryProvider.getDirectory());
      .................
    </tasklet2>
    <step2>
    that call fails because Tasklet from step1 seems to still be holding a lock on that file..

    Any ideas/input on why this is happening and how we can solve the problem much appreciated. We are using the commons FileUtils is that plays any role.

    Regards,
    Savvas

  2. #2
    Join Date
    Jul 2009
    Location
    London, UK
    Posts
    47

    Default

    ..never mind..our bad..the lock was being acquired (and never released..) elsewhere..

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •