本文整理了Java中com.sun.enterprise.util.io.FileUtils.deleteFileNowOrLater()
方法的一些代码示例,展示了FileUtils.deleteFileNowOrLater()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。FileUtils.deleteFileNowOrLater()
方法的具体详情如下:
包路径:com.sun.enterprise.util.io.FileUtils
类名称:FileUtils
方法名:deleteFileNowOrLater
[英]Delete a file. If impossible to delete then try to delete it when the JVM exits. E.g. when Windows is using a jar in the current JVM -- you can not delete the jar until the JVM dies.
[中]删除一个文件。如果无法删除,则在JVM退出时尝试删除它。例如,当Windows在当前JVM中使用jar时——在JVM死掉之前,您不能删除jar。
代码示例来源:origin: org.glassfish.main.core/kernel
/**
* It is **Essential** to delete this file! Other code will assume the server
* is running if it exists.
* Any old App is currently (10/10/10) allowed to add a shutdownhook with a System.exit()
* which is GUARANTEED to prevent the shutdown hook for deleting the pidfile to run.
* So -- we always do it BEFORE trying to exit.
*/
private void deletePidFile(ServerEnvironment env) {
File pidFile = new File(env.getConfigDirPath(), "pid");
if (pidFile.isFile()) {
FileUtils.deleteFileNowOrLater(pidFile);
}
}
}
代码示例来源:origin: org.glassfish.main.cluster/cluster-cli
_rendezvousOccurred = true;
} catch (CommandException ce) {
FileUtils.deleteFileNowOrLater(instanceDir);
throw ce;
内容来源于网络,如有侵权,请联系作者删除!