本文整理汇总了Java中org.eclipse.core.filesystem.IFileSystem类的典型用法代码示例。如果您正苦于以下问题:Java IFileSystem类的具体用法?Java IFileSystem怎么用?Java IFileSystem使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
IFileSystem类属于org.eclipse.core.filesystem包,在下文中一共展示了IFileSystem类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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: 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;
}
示例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;
}
示例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;
}
示例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);
}
示例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));
}
}
示例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));
}
}
示例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;
}
}
示例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);
}
示例11: getFileSystem
import org.eclipse.core.filesystem.IFileSystem; //导入依赖的package包/类
@Override
public IFileSystem getFileSystem() {
return mStore.getFileSystem();
}
示例12: getFileSystem
import org.eclipse.core.filesystem.IFileSystem; //导入依赖的package包/类
/** Get the file-system managing this file store */
/* Override */
public IFileSystem getFileSystem()
{
return system;
}
示例13: getFileSystem
import org.eclipse.core.filesystem.IFileSystem; //导入依赖的package包/类
/** Returns the file-system that manages this file store*/
/* Override */
public IFileSystem getFileSystem()
{
return system;
}
示例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;
}
示例15: getFileSystem
import org.eclipse.core.filesystem.IFileSystem; //导入依赖的package包/类
@Override
public IFileSystem getFileSystem() {
return WorkspaceFileSystem.getInstance();
}