1

I am using truezip (7.7.9 version) to update an archive file in my Java code.

I am doing the above said in a try catch block when the TFile.umount is invoked, the code automatically skips the immediate lines in the try block and goes to finally.

Would really be helpful if anyone suggests a solution.

try
{
    //to commit the changes in archive file
    TFile.umount(archive);
    upload(archive); //this line never executed so, I've added this method to finally block.
}
catch(Exception ex)
{
    uncommitted = true;
    logger.log(Level.INFO,"errorcommitting"+archive.getName());
}
finally
{
    if(!uncommitted)
        upload(archive);
}

I've made changes to the code to make it workable, but it doesn't feel correct to do it in this way.

Andrews B Anthony
  • 1,381
  • 9
  • 27

0 Answers0