Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/java/395.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Java umount(归档)转到finally方法_Java_Truezip - Fatal编程技术网

Java umount(归档)转到finally方法

Java umount(归档)转到finally方法,java,truezip,Java,Truezip,我正在使用truezip(7.7.9版本)更新Java代码中的存档文件 我在一个试抓块中做上述操作 调用TFile.umount时,代码会自动跳过try块中的立即行,并转到finally 如果有人提出解决方案,那真的很有帮助 try { //to commit the changes in archive file TFile.umount(archive); upload(archive); //this line never executed so, I've add

我正在使用truezip(7.7.9版本)更新Java代码中的存档文件

我在一个试抓块中做上述操作 调用
TFile.umount
时,代码会自动跳过
try
块中的立即行,并转到
finally

如果有人提出解决方案,那真的很有帮助

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);
}

我已经对代码进行了修改,以使其可行,但这样做感觉不正确。

发布代码,pleasedone@adammichalik不确定我是否正确理解了这个问题,但它似乎按照预期工作,因为finally块始终被执行。这是您真正的代码吗
TFile.umount(archive)
try
块中的最后一行,因此成功执行的下一条指令是执行
finally
块。那是什么问题?你现在能查一下吗@Adammichalik发布代码,pleasedone@adammichalik不确定我是否正确理解了这个问题,但它似乎按照预期工作,因为finally块总是被执行。这是你真正的代码吗
TFile.umount(archive)
try
块中的最后一行,因此成功执行的下一条指令是执行
finally
块。那是什么问题?你现在能查一下吗@阿达米恰利克