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


Java IFileSystem.getStore方法代码示例

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


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

示例1: compile

import org.eclipse.core.filesystem.IFileSystem; //导入方法依赖的package包/类
private void compile(IRepository repository, final String inputPathAsString, final String outputPathAsString)
		throws CoreException {
	IFileSystem localFS = EFS.getLocalFileSystem();
	final IFileStore outputPath = localFS.getStore(new Path(outputPathAsString));
	LocationContext context = new LocationContext(outputPath);
	final IFileStore sourcePath = localFS.getStore(new Path(inputPathAsString));
	if (!sourcePath.fetchInfo().exists()) {
		System.err.println(sourcePath + " does not exist");
		System.exit(1);
	}
	context.addSourcePath(sourcePath, outputPath);
	int mode = ICompilationDirector.CLEAN | ICompilationDirector.FULL_BUILD;
	if (Boolean.getBoolean("args.debug"))
		mode |= ICompilationDirector.DEBUG;
	IProblem[] problems = CompilationDirector.getInstance().compile(null, repository, context, mode, null);
	if (problems.length > 0) {
		MultiStatus parent = new MultiStatus(FrontEnd.PLUGIN_ID, IStatus.OK, "Problems occurred", null);
		for (int i = 0; i < problems.length; i++) {
			String message = problems[i].toString();
			parent.add(buildStatus(message, null));
		}
		LogUtils.log(parent);
	} else
		LogUtils.logInfo(FrontEnd.PLUGIN_ID, "Done", null);
}
 
开发者ID:abstratt,项目名称:textuml,代码行数:26,代码来源:CompilationDirectorCLI.java

示例2: populate

import org.eclipse.core.filesystem.IFileSystem; //导入方法依赖的package包/类
public void populate(String source, IContainer container, IProject project) {
        // Copy
        IFileSystem fileSystem = EFS.getLocalFileSystem();
//        File source = (File) new File();
        IFileStore sourceDir = new ReadWriteFileStore(
        		fileSystem.getStore(container.getFolder(new Path(source)).getLocationURI()//source.toURI()
                		));
        IFileStore destDir = new ReadWriteFileStore(
                fileSystem.getStore(getAbsolutePath(project)));
        try {
            sourceDir.copy(destDir, EFS.OVERWRITE, null);
        } catch (CoreException e) {
//            AdtPlugin.log(e, null);
        }
    }
 
开发者ID:thahn0720,项目名称:agui_eclipse_plugin,代码行数:16,代码来源:AguiProjectMaker.java

示例3: getFileStore

import org.eclipse.core.filesystem.IFileSystem; //导入方法依赖的package包/类
protected IFileStore getFileStore(URI uri) throws CoreException
{
	IFileSystem fileSystem = EFS.getFileSystem(uri.getScheme());
	if (fileSystem == null)
	{
		return EFS.getNullFileSystem().getStore(uri);
	}
	return fileSystem.getStore(uri);
}
 
开发者ID:apicloudcom,项目名称:APICloud-Studio,代码行数:10,代码来源:URIResolver.java

示例4: execute

import org.eclipse.core.filesystem.IFileSystem; //导入方法依赖的package包/类
@SuppressWarnings("unchecked")
public void execute() throws BuildException {
	IProgressMonitor monitor = null;
	Hashtable references = getProject().getReferences();
	if (references != null)
		monitor = (IProgressMonitor) references
				.get(AntCorePlugin.ECLIPSE_PROGRESS_MONITOR);
	IFileSystem localFS = EFS.getLocalFileSystem();
	if (dest == null)
		dest = new File(".");
	final IFileStore outputPath = localFS.getStore(new Path(getDest()
			.getAbsolutePath()));

	LocationContext context = new LocationContext(outputPath);

	if (resources.isFilesystemOnly()) {
		for (Iterator iter = resources.iterator(); iter.hasNext();) {
			FileResource res = (FileResource) iter.next();
			if (res.isExists()) {
				context.addSourcePath(localFS.getStore(new Path(res
						.getFile().getAbsolutePath())), outputPath);
				log("Resource added: " + res.getFile());
			} else
				log("Resource doesn't not exist: " + res.getFile(),
						Project.MSG_ERR);
		}
	} else
		throw new BuildException("Only filesystem resources supported.");
	log("Output is: " + outputPath.toString());
	int mode = 0;
	if (clean)
		mode |= ICompilationDirector.CLEAN;
	if (fullBuild)
		mode |= ICompilationDirector.FULL_BUILD;
	if (debug)
		mode |= ICompilationDirector.DEBUG;
	log("Mode = " + mode + " :" + (clean ? " CLEAN" : "")
			+ (fullBuild ? " FULL_BUILD" : "") + (debug ? " DEBUG" : ""));
	try {
		IProblem[] problems = CompilationDirector.getInstance().compile(
				null, null, context, mode, monitor);
		for (IProblem problem : problems) {
			log(problem.getMessage(), Project.MSG_ERR);
		}
		if (problems.length != 0)
			throw new BuildException("Compilation failed.");
	} catch (CoreException e) {
		throw new BuildException(e);
	}

}
 
开发者ID:abstratt,项目名称:textuml,代码行数:52,代码来源:CompileTask.java


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