本文整理汇总了Java中org.eclipse.core.resources.IResource.delete方法的典型用法代码示例。如果您正苦于以下问题:Java IResource.delete方法的具体用法?Java IResource.delete怎么用?Java IResource.delete使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.eclipse.core.resources.IResource
的用法示例。
在下文中一共展示了IResource.delete方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: cleanOutput
import org.eclipse.core.resources.IResource; //导入方法依赖的package包/类
private void cleanOutput(IProject aProject, OutputConfiguration config, IProgressMonitor monitor)
throws CoreException {
IContainer container = getContainer(aProject, config.getOutputDirectory());
if (!container.exists()) {
return;
}
if (config.isCanClearOutputDirectory()) {
for (IResource resource : container.members()) {
resource.delete(IResource.KEEP_HISTORY, monitor);
}
} else if (config.isCleanUpDerivedResources()) {
List<IFile> resources = derivedResourceMarkers.findDerivedResources(container, null);
for (IFile iFile : resources) {
iFile.delete(IResource.KEEP_HISTORY, monitor);
}
}
}
示例2: fullBuild
import org.eclipse.core.resources.IResource; //导入方法依赖的package包/类
protected void fullBuild(IProgressMonitor monitor) throws CoreException{
Visuflow.getDefault().getLogger().info("Build Start");
String targetFolder = "sootOutput";
IJavaProject project = JavaCore.create(getProject());
IResourceDelta delta = getDelta(project.getProject());
if (delta == null || !delta.getAffectedChildren()[0].getProjectRelativePath().toString().equals(targetFolder)) {
classpath = getSootCP(project);
String location = GlobalSettings.get("Target_Path");
IFolder folder = project.getProject().getFolder(targetFolder);
// at this point, no resources have been created
if (!folder.exists()) {
// Changed to force because of bug id vis-119
folder.create(IResource.FORCE, true, monitor);
} else {
for (IResource resource : folder.members()) {
resource.delete(IResource.FORCE, monitor);
}
}
classpath = location + classpath;
String[] sootString = new String[] { "-cp", classpath, "-exclude", "javax", "-allow-phantom-refs", "-no-bodies-for-excluded", "-process-dir",
location, "-src-prec", "only-class", "-w", "-output-format", "J", "-keep-line-number", "-output-dir",
folder.getLocation().toOSString()/* , "tag.ln","on" */ };
ICFGStructure icfg = new ICFGStructure();
JimpleModelAnalysis analysis = new JimpleModelAnalysis();
analysis.setSootString(sootString);
List<VFClass> jimpleClasses = new ArrayList<>();
try {
analysis.createICFG(icfg, jimpleClasses);
fillDataModel(icfg, jimpleClasses);
} catch(Exception e) {
logger.error("Couldn't execute analysis", e);
}
folder.refreshLocal(IResource.DEPTH_INFINITE, monitor);
}
}