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