本文整理匯總了Java中com.intellij.openapi.util.io.FileUtil.asyncDelete方法的典型用法代碼示例。如果您正苦於以下問題:Java FileUtil.asyncDelete方法的具體用法?Java FileUtil.asyncDelete怎麽用?Java FileUtil.asyncDelete使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類com.intellij.openapi.util.io.FileUtil
的用法示例。
在下文中一共展示了FileUtil.asyncDelete方法的4個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: restoreFromUndoStorage
import com.intellij.openapi.util.io.FileUtil; //導入方法依賴的package包/類
private void restoreFromUndoStorage(final File dst) {
String normPath = FileUtil.toSystemIndependentName(dst.getPath());
for (Iterator<Couple<File>> it = myUndoStorageContents.iterator(); it.hasNext();) {
Couple<File> e = it.next();
final String p = FileUtil.toSystemIndependentName(e.first.getPath());
if (p.startsWith(normPath)) {
try {
FileUtil.rename(e.second, e.first);
}
catch (IOException ex) {
LOG.error(ex);
FileUtil.asyncDelete(e.second);
}
it.remove();
}
}
if (myStorageForUndo != null) {
final File[] files = myStorageForUndo.listFiles();
if (files == null || files.length == 0) {
FileUtil.asyncDelete(myStorageForUndo);
myStorageForUndo = null;
}
}
}
示例2: tearDown
import com.intellij.openapi.util.io.FileUtil; //導入方法依賴的package包/類
@Override
protected void tearDown() throws Exception {
super.tearDown();
if (myTempDir != null) {
FileUtil.asyncDelete(myTempDir);
}
Disposer.dispose(myRootDisposable);
}
示例3: deletePycFiles
import com.intellij.openapi.util.io.FileUtil; //導入方法依賴的package包/類
public static void deletePycFiles(String pyFilePath) {
if (pyFilePath.endsWith(".py")) {
List<File> filesToDelete = new ArrayList<File>();
File pyc = new File(pyFilePath + "c");
if (pyc.exists()) {
filesToDelete.add(pyc);
}
File pyo = new File(pyFilePath + "o");
if (pyo.exists()) {
filesToDelete.add(pyo);
}
final File file = new File(pyFilePath);
File pycache = new File(file.getParentFile(), PyNames.PYCACHE);
if (pycache.isDirectory()) {
final String shortName = FileUtil.getNameWithoutExtension(file);
Collections.addAll(filesToDelete, pycache.listFiles(new FileFilter() {
@Override
public boolean accept(File pathname) {
if (!FileUtilRt.extensionEquals(pathname.getName(), "pyc")) return false;
String nameWithMagic = FileUtil.getNameWithoutExtension(pathname);
return FileUtil.getNameWithoutExtension(nameWithMagic).equals(shortName);
}
}));
}
FileUtil.asyncDelete(filesToDelete);
}
}
示例4: clearCache
import com.intellij.openapi.util.io.FileUtil; //導入方法依賴的package包/類
private void clearCache() {
if (cacheDir.exists()) {
File[] cacheFiles = cacheDir.listFiles();
if (cacheFiles != null) {
@SuppressWarnings("unused") // go/futurereturn-lsc
Future<?> possiblyIgnoredError = FileUtil.asyncDelete(Lists.newArrayList(cacheFiles));
}
}
sourceFileToCacheKey = null;
}