當前位置: 首頁>>代碼示例>>Java>>正文


Java FileUtil.asyncDelete方法代碼示例

本文整理匯總了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;
    }
  }
}
 
開發者ID:jskierbi,項目名稱:intellij-ce-playground,代碼行數:25,代碼來源:SvnFileSystemListener.java

示例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);
}
 
開發者ID:jskierbi,項目名稱:intellij-ce-playground,代碼行數:9,代碼來源:FlyIdeaTestCase.java

示例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);
  }
}
 
開發者ID:jskierbi,項目名稱:intellij-ce-playground,代碼行數:28,代碼來源:PyUtil.java

示例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;
}
 
開發者ID:bazelbuild,項目名稱:intellij,代碼行數:11,代碼來源:JarCache.java


注:本文中的com.intellij.openapi.util.io.FileUtil.asyncDelete方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。