本文整理了Java中org.apache.lucene.util.IOUtils.deleteFilesIfExist()
方法的一些代码示例,展示了IOUtils.deleteFilesIfExist()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。IOUtils.deleteFilesIfExist()
方法的具体详情如下:
包路径:org.apache.lucene.util.IOUtils
类名称:IOUtils
方法名:deleteFilesIfExist
[英]Deletes all given Paths, if they exist. Some of the Files may be null; they are ignored. After everything is deleted, the method either throws the first exception it hit while deleting, or completes normally if there were no exceptions.
[中]删除所有给定路径(如果存在)。某些文件可能为空;他们被忽视了。删除所有内容后,该方法要么抛出删除时遇到的第一个异常,要么在没有异常的情况下正常完成。
代码示例来源:origin: org.apache.lucene/lucene-core
/**
* Deletes all given <tt>Path</tt>s, if they exist. Some of the
* <tt>File</tt>s may be null; they are
* ignored. After everything is deleted, the method either
* throws the first exception it hit while deleting, or
* completes normally if there were no exceptions.
*
* @param files files to delete
*/
public static void deleteFilesIfExist(Path... files) throws IOException {
deleteFilesIfExist(Arrays.asList(files));
}
代码示例来源:origin: org.infinispan/infinispan-embedded-query
/**
* Deletes all given <tt>Path</tt>s, if they exist. Some of the
* <tt>File</tt>s may be null; they are
* ignored. After everything is deleted, the method either
* throws the first exception it hit while deleting, or
* completes normally if there were no exceptions.
*
* @param files files to delete
*/
public static void deleteFilesIfExist(Path... files) throws IOException {
deleteFilesIfExist(Arrays.asList(files));
}
代码示例来源:origin: harbby/presto-connectors
/**
* Deletes all given <tt>Path</tt>s, if they exist. Some of the
* <tt>File</tt>s may be null; they are
* ignored. After everything is deleted, the method either
* throws the first exception it hit while deleting, or
* completes normally if there were no exceptions.
*
* @param files files to delete
*/
public static void deleteFilesIfExist(Path... files) throws IOException {
deleteFilesIfExist(Arrays.asList(files));
}
代码示例来源:origin: org.apache.solr/solr-test-framework
public void tearDown() throws Exception {
IOUtils.deleteFilesIfExist(baseDir.toPath());
}
代码示例来源:origin: org.apache.servicemix.bundles/org.apache.servicemix.bundles.lucene
/**
* Deletes all given <tt>Path</tt>s, if they exist. Some of the
* <tt>File</tt>s may be null; they are
* ignored. After everything is deleted, the method either
* throws the first exception it hit while deleting, or
* completes normally if there were no exceptions.
*
* @param files files to delete
*/
public static void deleteFilesIfExist(Path... files) throws IOException {
deleteFilesIfExist(Arrays.asList(files));
}
代码示例来源:origin: harbby/presto-connectors
private void close() throws IOException {
boolean success = false;
try {
IOUtils.close(reader);
success = true;
} finally {
if (success) {
IOUtils.deleteFilesIfExist(tempInput, tempSorted);
} else {
IOUtils.deleteFilesIgnoringExceptions(tempInput, tempSorted);
}
}
}
代码示例来源:origin: harbby/presto-connectors
/**
* Removes any written temporary files.
*/
@Override
public void close() throws IOException {
boolean success = false;
try {
closeWriter();
success = true;
} finally {
if (success) {
IOUtils.deleteFilesIfExist(input, sorted);
} else {
IOUtils.deleteFilesIgnoringExceptions(input, sorted);
}
}
}
代码示例来源:origin: org.infinispan/infinispan-embedded-query
} finally {
if (success2) {
IOUtils.deleteFilesIfExist(merges);
} else {
IOUtils.deleteFilesIgnoringExceptions(merges);
} finally {
if (success3) {
IOUtils.deleteFilesIfExist(merges);
} else {
IOUtils.deleteFilesIgnoringExceptions(merges);
代码示例来源:origin: harbby/presto-connectors
} finally {
if (success2) {
IOUtils.deleteFilesIfExist(merges);
} else {
IOUtils.deleteFilesIgnoringExceptions(merges);
} finally {
if (success3) {
IOUtils.deleteFilesIfExist(merges);
} else {
IOUtils.deleteFilesIgnoringExceptions(merges);
代码示例来源:origin: harbby/presto-connectors
IOUtils.deleteFilesIfExist(tempInput, tempSorted);
} else {
IOUtils.deleteFilesIgnoringExceptions(tempInput, tempSorted);
代码示例来源:origin: harbby/presto-connectors
IOUtils.deleteFilesIfExist(tempInput, tempSorted);
} else {
IOUtils.deleteFilesIgnoringExceptions(tempInput, tempSorted);
内容来源于网络,如有侵权,请联系作者删除!