本文整理汇总了Java中org.eclipse.core.filesystem.IFileSystem类的典型用法代码示例。如果您正苦于以下问题:Java IFileSystem类的具体用法?Java IFileSystem怎么用?Java IFileSystem使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
IFileSystem类属于org.eclipse.core.filesystem包,在下文中一共展示了IFileSystem类的16个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的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: getFileSystem
import org.eclipse.core.filesystem.IFileSystem; //导入依赖的package包/类
/** Because of an eclipse bug returns a magic file system */
/* Override */
public IFileSystem getFileSystem()
{
// For Eclipse bug
return hackSystem;
}
开发者ID:brocade,项目名称:vTM-eclipse,代码行数:8,代码来源:RuleDirectoryFileStore.java
示例4: getInstance
import org.eclipse.core.filesystem.IFileSystem; //导入依赖的package包/类
public static IFileSystem getInstance() {
if (instance == null) {
try {
EFS.getFileSystem(SCHEME_VIRTUAL);
} catch (CoreException e) {
throw new RuntimeException(e);
}
}
return instance;
}
开发者ID:apicloudcom,项目名称:APICloud-Studio,代码行数:11,代码来源:VirtualFileSystem.java
示例5: getInstance
import org.eclipse.core.filesystem.IFileSystem; //导入依赖的package包/类
public static IFileSystem getInstance() {
if (instance == null) {
try {
instance = EFS.getFileSystem(SCHEME_WORKSPACE);
} catch (CoreException e) {
throw new RuntimeException(e);
}
}
return instance;
}
开发者ID:apicloudcom,项目名称:APICloud-Studio,代码行数:11,代码来源:WorkspaceFileSystem.java
示例6: 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
示例7: copy
import org.eclipse.core.filesystem.IFileSystem; //导入依赖的package包/类
/**
* Copies a file or folder.
* @param monitor the current progress monitor
* @param src the source file or folder
* @param dst the target file or folder
* @throws IOException if the operation was failed
*/
public static void copy(IProgressMonitor monitor, File src, File dst) throws IOException {
IFileSystem fs = EFS.getLocalFileSystem();
IFileStore from = fs.fromLocalFile(src);
IFileStore to = fs.fromLocalFile(dst);
try {
from.copy(to, EFS.OVERWRITE, monitor);
} catch (CoreException e) {
LogUtil.log(e.getStatus());
throw new IOException(MessageFormat.format(
Messages.IoUtils_errorFailedToCopyFile,
src, dst));
}
}
开发者ID:asakusafw,项目名称:asakusafw-shafu,代码行数:21,代码来源:IoUtils.java
示例8: move
import org.eclipse.core.filesystem.IFileSystem; //导入依赖的package包/类
/**
* Moves a file or folder.
* @param monitor the current progress monitor
* @param src the source file or folder
* @param dst the target file or folder
* @throws IOException if the operation was failed
*/
public static void move(IProgressMonitor monitor, File src, File dst) throws IOException {
IFileSystem fs = EFS.getLocalFileSystem();
IFileStore from = fs.fromLocalFile(src);
IFileStore to = fs.fromLocalFile(dst);
try {
from.move(to, EFS.OVERWRITE, monitor);
} catch (CoreException e) {
LogUtil.log(e.getStatus());
throw new IOException(MessageFormat.format(
Messages.IoUtils_errorFailedToMoveFile,
src, dst));
}
}
开发者ID:asakusafw,项目名称:asakusafw-shafu,代码行数:21,代码来源:IoUtils.java
示例9: delete0
import org.eclipse.core.filesystem.IFileSystem; //导入依赖的package包/类
private static boolean delete0(IProgressMonitor monitor, File file) {
if (file.exists() == false) {
monitor.done();
return true;
}
IFileSystem fs = EFS.getLocalFileSystem();
IFileStore store = fs.fromLocalFile(file);
try {
store.delete(EFS.ATTRIBUTE_SYMLINK, monitor);
return true;
} catch (CoreException e) {
LogUtil.log(e.getStatus());
return false;
}
}
开发者ID:asakusafw,项目名称:asakusafw-shafu,代码行数:16,代码来源:IoUtils.java
示例10: openEditorUnchecked
import org.eclipse.core.filesystem.IFileSystem; //导入依赖的package包/类
/**
* @param file The file to open
* @param name A human readable name for the input file. If the file name is to be used, pass {@link File#getName()}
* @see UIHelper#openEditorUnchecked(String, IEditorInput, boolean)
*/
public static IEditorPart openEditorUnchecked(final String editorId, final File file, final String name, final boolean activate) throws PartInitException {
final IFileSystem localFileSystem = EFS.getLocalFileSystem();
final IFileStore fromLocalFile = localFileSystem.fromLocalFile(file);
return openEditorUnchecked(editorId, new NamedFileStoreEditorInput(fromLocalFile, name), activate);
}
开发者ID:tlaplus,项目名称:tlaplus,代码行数:11,代码来源:UIHelper.java
示例11: getFileSystem
import org.eclipse.core.filesystem.IFileSystem; //导入依赖的package包/类
@Override
public IFileSystem getFileSystem() {
return mStore.getFileSystem();
}
开发者ID:thahn0720,项目名称:agui_eclipse_plugin,代码行数:5,代码来源:FileStore.java
示例12: getFileSystem
import org.eclipse.core.filesystem.IFileSystem; //导入依赖的package包/类
/** Get the file-system managing this file store */
/* Override */
public IFileSystem getFileSystem()
{
return system;
}
开发者ID:brocade,项目名称:vTM-eclipse,代码行数:7,代码来源:EmptyFileStore.java
示例13: getFileSystem
import org.eclipse.core.filesystem.IFileSystem; //导入依赖的package包/类
/** Returns the file-system that manages this file store*/
/* Override */
public IFileSystem getFileSystem()
{
return system;
}
开发者ID:brocade,项目名称:vTM-eclipse,代码行数:7,代码来源:RuleFileStore.java
示例14: getFileSystem
import org.eclipse.core.filesystem.IFileSystem; //导入依赖的package包/类
/** Get the parent file-system, responsible for managing this file store */
/* Override */
public IFileSystem getFileSystem()
{
return system;
}
开发者ID:brocade,项目名称:vTM-eclipse,代码行数:7,代码来源:ZXTMDirectoryFileStore.java
示例15: getFileSystem
import org.eclipse.core.filesystem.IFileSystem; //导入依赖的package包/类
@Override
public IFileSystem getFileSystem() {
return WorkspaceFileSystem.getInstance();
}
开发者ID:apicloudcom,项目名称:APICloud-Studio,代码行数:5,代码来源:WorkspaceFile.java
示例16: 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类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论