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


Java IResource.delete方法代碼示例

本文整理匯總了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);
		}
	}
}
 
開發者ID:eclipse,項目名稱:n4js,代碼行數:18,代碼來源:CleanInstruction.java

示例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);
	}
}
 
開發者ID:VisuFlow,項目名稱:visuflow-plugin,代碼行數:39,代碼來源:JimpleBuilder.java


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