本文整理汇总了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
}
}
}
示例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);
}
}
示例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);
}
}
示例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);
}
}
示例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);
}