本文整理匯總了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);
}
}