本文整理了Java中com.sun.enterprise.util.io.FileUtils.doWithRetry()
方法的一些代码示例,展示了FileUtils.doWithRetry()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。FileUtils.doWithRetry()
方法的具体详情如下:
包路径:com.sun.enterprise.util.io.FileUtils
类名称:FileUtils
方法名:doWithRetry
[英]Executes the supplied work object until the work is done or the max. retry count is reached.
[中]执行提供的工作对象,直到工作完成或达到最大重试次数。
代码示例来源:origin: org.glassfish.main.common/common-util
int retries = doWithRetry(renameWork);
boolean result = renameWork.workComplete();
代码示例来源:origin: eclipse-ee4j/glassfish
int retries = doWithRetry(renameWork);
boolean result = renameWork.workComplete();
代码示例来源:origin: org.glassfish.main.common/common-util
DeleteFileWork work = new DeleteFileWork(f);
doWithRetry(work);
代码示例来源:origin: eclipse-ee4j/glassfish
DeleteFileWork work = new DeleteFileWork(f);
doWithRetry(work);
代码示例来源:origin: org.glassfish.main.common/common-util
/**
* Opens a stream to the specified output file, retrying if necessary.
*
* @param out the output File for which a stream is needed
* @return the FileOutputStream
* @throws IOException for any errors opening the stream
*/
public static FileOutputStream openFileOutputStream(File out) throws IOException {
FileOutputStreamWork work = new FileOutputStreamWork(out);
int retries = doWithRetry(work);
if (retries > 0) {
_utillogger.log(Level.FINE, "Retrying " + retries + " times");
}
if (work.workComplete()) {
return work.getStream();
} else {
IOException ioe = new IOException();
ioe.initCause(work.getLastError());
throw ioe;
}
}
代码示例来源:origin: org.glassfish.common/common-util
/**
* Opens a stream to the specified output file, retrying if necessary.
*
* @param out the output File for which a stream is needed
* @return the FileOutputStream
* @throws IOException for any errors opening the stream
*/
public static FileOutputStream openFileOutputStream(File out) throws IOException {
FileOutputStreamWork work = new FileOutputStreamWork(out);
int retries = doWithRetry(work);
if (retries > 0) {
_utillogger.log(Level.FINE, "Retrying " + retries + " times");
}
if (work.workComplete()) {
return work.getStream();
} else {
IOException ioe = new IOException();
ioe.initCause(work.getLastError());
throw ioe;
}
}
代码示例来源:origin: eclipse-ee4j/glassfish
/**
* Opens a stream to the specified output file, retrying if necessary.
*
* @param out the output File for which a stream is needed
* @return the FileOutputStream
* @throws IOException for any errors opening the stream
*/
public static FileOutputStream openFileOutputStream(File out) throws IOException {
FileOutputStreamWork work = new FileOutputStreamWork(out);
int retries = doWithRetry(work);
if (retries > 0) {
_utillogger.log(Level.FINE, "Retrying " + retries + " times");
}
if (work.workComplete()) {
return work.getStream();
} else {
IOException ioe = new IOException();
ioe.initCause(work.getLastError());
throw ioe;
}
}
代码示例来源:origin: org.glassfish.common/common-util
int retries = doWithRetry(renameWork);
boolean result = renameWork.workComplete();
内容来源于网络,如有侵权,请联系作者删除!