com.sun.enterprise.util.io.FileUtils.doWithRetry()方法的使用及代码示例

x33g5p2x  于2022-01-19 转载在 其他  
字(2.8k)|赞(0)|评价(0)|浏览(119)

本文整理了Java中com.sun.enterprise.util.io.FileUtils.doWithRetry()方法的一些代码示例,展示了FileUtils.doWithRetry()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。FileUtils.doWithRetry()方法的具体详情如下:
包路径:com.sun.enterprise.util.io.FileUtils
类名称:FileUtils
方法名:doWithRetry

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

相关文章