当前位置: 首页>>代码示例>>Java>>正文


Java Files.cleanFolder方法代码示例

本文整理汇总了Java中org.eclipse.xtext.util.Files.cleanFolder方法的典型用法代码示例。如果您正苦于以下问题:Java Files.cleanFolder方法的具体用法?Java Files.cleanFolder怎么用?Java Files.cleanFolder使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.eclipse.xtext.util.Files的用法示例。


在下文中一共展示了Files.cleanFolder方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: cleanUpTmpFolder

import org.eclipse.xtext.util.Files; //导入方法依赖的package包/类
protected void cleanUpTmpFolder(File tempDir) {
	if (temporaryFolder == null || !temporaryFolder.isInitialized()) {
		try {
			tempDir.deleteOnExit();
			// Classloader needs .class files to lazy load an anonymous non static classes
			Files.cleanFolder(tempDir, new FileFilter() {
				@Override
				public boolean accept(File pathname) {
					boolean isClass = pathname.getName().endsWith(".class");
					if(isClass) {
						pathname.deleteOnExit();
					}
					return !isClass;
				}
			}, true, true);
		} catch (FileNotFoundException e) {
			// ignore
		}
	}
}
 
开发者ID:eclipse,项目名称:xtext-extras,代码行数:21,代码来源:OnTheFlyJavaCompiler.java

示例2: getRoot

import org.eclipse.xtext.util.Files; //导入方法依赖的package包/类
protected File getRoot(final String path) {
  try {
    File _xblockexpression = null;
    {
      final File root = new File(path);
      boolean _mkdirs = root.mkdirs();
      boolean _not = (!_mkdirs);
      if (_not) {
        Files.cleanFolder(root, null, true, false);
      }
      root.deleteOnExit();
      _xblockexpression = root;
    }
    return _xblockexpression;
  } catch (Throwable _e) {
    throw Exceptions.sneakyThrow(_e);
  }
}
 
开发者ID:eclipse,项目名称:xtext-core,代码行数:19,代码来源:MultiProjectTest.java

示例3: setup

import org.eclipse.xtext.util.Files; //导入方法依赖的package包/类
@Before
public void setup() {
  try {
    ServerModule _serverModule = new ServerModule();
    final Injector injector = Guice.createInjector(_serverModule);
    injector.injectMembers(this);
    File _file = new File("./test-data/test-project");
    this.root = _file;
    boolean _mkdirs = this.root.mkdirs();
    boolean _not = (!_mkdirs);
    if (_not) {
      Files.cleanFolder(this.root, null, true, false);
    }
    this.root.deleteOnExit();
    final Procedure2<URI, Iterable<Issue>> _function = (URI $0, Iterable<Issue> $1) -> {
      this.diagnostics.put($0, IterableExtensions.<Issue>toList($1));
    };
    this.workspaceManger.initialize(this.uriExtensions.withEmptyAuthority(URI.createFileURI(this.root.getAbsolutePath())), _function, null);
  } catch (Throwable _e) {
    throw Exceptions.sneakyThrow(_e);
  }
}
 
开发者ID:eclipse,项目名称:xtext-core,代码行数:23,代码来源:WorkspaceManagerTest.java

示例4: setup

import org.eclipse.xtext.util.Files; //导入方法依赖的package包/类
@Before
public void setup() {
  try {
    final Injector injector = Guice.createInjector(this.getServerModule());
    injector.injectMembers(this);
    final Object resourceServiceProvider = this.resourceServerProviderRegistry.getExtensionToFactoryMap().get(this.fileExtension);
    if ((resourceServiceProvider instanceof IResourceServiceProvider)) {
      this.languageInfo = ((IResourceServiceProvider)resourceServiceProvider).<LanguageInfo>get(LanguageInfo.class);
    }
    this.languageServer.connect(ServiceEndpoints.<LanguageClientExtensions>toServiceObject(this, LanguageClientExtensions.class));
    this.languageServer.supportedMethods();
    File _absoluteFile = new File("").getAbsoluteFile();
    File _file = new File(_absoluteFile, "/test-data/test-project");
    this.root = _file;
    boolean _mkdirs = this.root.mkdirs();
    boolean _not = (!_mkdirs);
    if (_not) {
      Files.cleanFolder(this.root, null, true, false);
    }
    this.root.deleteOnExit();
  } catch (Throwable _e) {
    throw Exceptions.sneakyThrow(_e);
  }
}
 
开发者ID:eclipse,项目名称:xtext-core,代码行数:25,代码来源:AbstractLanguageServerTest.java

示例5: cleanFolder

import org.eclipse.xtext.util.Files; //导入方法依赖的package包/类
public static void cleanFolder(String srcGenPath) throws FileNotFoundException {
	File f = new File(srcGenPath);
	if (!f.exists())
		throw new FileNotFoundException(srcGenPath + " " + f.getAbsolutePath());
	log.info("Cleaning folder " + f.getPath());
	Files.cleanFolder(f, new FileFilter() {
		private final Collection<String> excludes = new HashSet<String>(Arrays.asList(defaultExcludes));
		@Override
		public boolean accept(File pathname) {
			return !excludes.contains(pathname.getName());
		}
	}, false, false);
}
 
开发者ID:eclipse,项目名称:xtext-extras,代码行数:14,代码来源:GeneratorUtil.java


注:本文中的org.eclipse.xtext.util.Files.cleanFolder方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。