本文整理了Java中org.eclipse.core.filesystem.EFS.getStore()
方法的一些代码示例,展示了EFS.getStore()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。EFS.getStore()
方法的具体详情如下:
包路径:org.eclipse.core.filesystem.EFS
类名称:EFS
方法名:getStore
[英]Returns the file store corresponding to the provided URI.
[中]返回与提供的URI对应的文件存储。
代码示例来源:origin: org.eclipse.scout.sdk.deps/org.eclipse.core.resources
/**
* Returns a string representation of a URI suitable for displaying to an end user.
*/
private String toString(URI uri) {
try {
return EFS.getStore(uri).toString();
} catch (CoreException e) {
//there is no store defined, so the best we can do is the URI toString.
return uri.toString();
}
}
代码示例来源:origin: org.eclipse.scout.sdk.deps/org.eclipse.ui.ide
@Override
public <T> T getAdapter(Object adaptableObject, Class<T> adapterType) {
if (adaptableObject instanceof FileStoreEditorInput && adapterType.isAssignableFrom(IFileStore.class)) {
FileStoreEditorInput editorInput = (FileStoreEditorInput) adaptableObject;
try {
return adapterType.cast(EFS.getStore(editorInput.getURI()));
} catch (CoreException e) {
// Ignore to return null.
}
}
return null;
}
代码示例来源:origin: org.eclipse.platform/org.eclipse.core.resources
/**
* Returns a string representation of a URI suitable for displaying to an end user.
*/
private String toString(URI uri) {
try {
return EFS.getStore(uri).toString();
} catch (CoreException e) {
//there is no store defined, so the best we can do is the URI toString.
return uri.toString();
}
}
代码示例来源:origin: org.eclipse.platform/org.eclipse.core.resources
/**
* Returns the local path for the given URI, or null if not possible.
*/
private IPath toLocalPath(URI uri) {
try {
final File localFile = EFS.getStore(uri).toLocalFile(EFS.NONE, null);
return localFile == null ? null : new Path(localFile.getAbsolutePath());
} catch (CoreException e) {
return FileUtil.toPath(uri);
}
}
代码示例来源:origin: org.eclipse.scout.sdk.deps/org.eclipse.core.resources
/**
* Returns the local path for the given URI, or null if not possible.
*/
private IPath toLocalPath(URI uri) {
try {
final File localFile = EFS.getStore(uri).toLocalFile(EFS.NONE, null);
return localFile == null ? null : new Path(localFile.getAbsolutePath());
} catch (CoreException e) {
return FileUtil.toPath(uri);
}
}
代码示例来源:origin: org.eclipse.scout.sdk.deps/org.eclipse.jdt.core
public static File toLocalFile(URI uri, IProgressMonitor monitor) throws CoreException {
IFileStore fileStore = EFS.getStore(uri);
File localFile = fileStore.toLocalFile(EFS.NONE, monitor);
if (localFile ==null)
// non local file system
localFile= fileStore.toLocalFile(EFS.CACHE, monitor);
return localFile;
}
/**
代码示例来源:origin: com.google.code.maven-play-plugin.org.eclipse.jdt/org.eclipse.jdt.core
public static File toLocalFile(URI uri, IProgressMonitor monitor) throws CoreException {
IFileStore fileStore = EFS.getStore(uri);
File localFile = fileStore.toLocalFile(EFS.NONE, monitor);
if (localFile ==null)
// non local file system
localFile= fileStore.toLocalFile(EFS.CACHE, monitor);
return localFile;
}
/**
代码示例来源:origin: at.bestsolution.efxclipse.eclipse/org.eclipse.core.resources
private IFileStore computeDestinationStore(IProjectDescription destDescription) throws CoreException {
URI destLocation = destDescription.getLocationURI();
// Use the default area if necessary for the destination.
if (destLocation == null) {
IPath rootLocation = ResourcesPlugin.getWorkspace().getRoot().getLocation();
destLocation = rootLocation.append(destDescription.getName()).toFile().toURI();
}
return EFS.getStore(destLocation);
}
代码示例来源:origin: com.vaadin/vaadin-client-compiler-deps
public static File toLocalFile(URI uri, IProgressMonitor monitor) throws CoreException {
IFileStore fileStore = EFS.getStore(uri);
File localFile = fileStore.toLocalFile(EFS.NONE, monitor);
if (localFile ==null)
// non local file system
localFile= fileStore.toLocalFile(EFS.CACHE, monitor);
return localFile;
}
/**
代码示例来源:origin: trylimits/Eclipse-Postfix-Code-Completion
public static File toLocalFile(URI uri, IProgressMonitor monitor) throws CoreException {
IFileStore fileStore = EFS.getStore(uri);
File localFile = fileStore.toLocalFile(EFS.NONE, monitor);
if (localFile ==null)
// non local file system
localFile= fileStore.toLocalFile(EFS.CACHE, monitor);
return localFile;
}
/**
代码示例来源:origin: org.eclipse.jdt/org.eclipse.jdt.core
public static File toLocalFile(URI uri, IProgressMonitor monitor) throws CoreException {
IFileStore fileStore = EFS.getStore(uri);
File localFile = fileStore.toLocalFile(EFS.NONE, monitor);
if (localFile ==null)
// non local file system
localFile= fileStore.toLocalFile(EFS.CACHE, monitor);
return localFile;
}
/**
代码示例来源:origin: org.eclipse/org.eclipse.core.filebuffers
public boolean isTextFileLocation(IPath location, boolean strict) {
Assert.isNotNull(location);
location= normalizeLocation(location);
try {
return isTextFileLocation(EFS.getStore(URIUtil.toURI(location)), strict);
} catch (CoreException ex) {
return false;
}
}
代码示例来源:origin: org.eclipse.platform/org.eclipse.core.filebuffers
@Override
public void create(IPath location, IProgressMonitor monitor) throws CoreException {
fLocation= location;
create(EFS.getStore(URIUtil.toURI(getLocation())), monitor);
}
代码示例来源:origin: org.eclipse.pde/org.eclipse.pde.ui
@Override
protected void createSystemFileContexts(InputContextManager manager, FileStoreEditorInput input) {
try {
IFileStore store = EFS.getStore(input.getURI());
IEditorInput in = new FileStoreEditorInput(store);
manager.putContext(in, new CategoryInputContext(this, in, true));
} catch (CoreException e) {
PDEPlugin.logException(e);
}
}
代码示例来源:origin: org.eclipse.pde/org.eclipse.pde.ui
private IBaseModel createSystemFileModel(IURIEditorInput input) throws CoreException {
IFileStore store = EFS.getStore(input.getURI());
ExternalFeatureModel model = new ExternalFeatureModel();
model.setInstallLocation(store.getParent().toString());
model.load(store.openInputStream(EFS.CACHE, new NullProgressMonitor()), true);
return model;
}
代码示例来源:origin: org.eclipse.jdt/org.eclipse.jdt.ui
private void deleteProjectFile(URI projectLocation) throws CoreException {
IFileStore file= EFS.getStore(projectLocation);
if (file.fetchInfo().exists()) {
IFileStore projectFile= file.getChild(FILENAME_PROJECT);
if (projectFile.fetchInfo().exists()) {
projectFile.delete(EFS.NONE, null);
}
}
}
代码示例来源:origin: org.eclipse.scout.sdk.deps/org.eclipse.jdt.ui
private void deleteProjectFile(URI projectLocation) throws CoreException {
IFileStore file= EFS.getStore(projectLocation);
if (file.fetchInfo().exists()) {
IFileStore projectFile= file.getChild(FILENAME_PROJECT);
if (projectFile.fetchInfo().exists()) {
projectFile.delete(EFS.NONE, null);
}
}
}
代码示例来源:origin: io.sarl/io.sarl.eclipse
private static void deleteProjectFile(URI projectLocation) throws CoreException {
final IFileStore file = EFS.getStore(projectLocation);
if (file.fetchInfo().exists()) {
final IFileStore projectFile = file.getChild(FILENAME_PROJECT);
if (projectFile.fetchInfo().exists()) {
projectFile.delete(EFS.NONE, null);
}
}
}
代码示例来源:origin: org.eclipse/org.eclipse.jdt.ui
private void deleteProjectFile(URI projectLocation) throws CoreException {
IFileStore file= EFS.getStore(projectLocation);
if (file.fetchInfo().exists()) {
IFileStore projectFile= file.getChild(FILENAME_PROJECT);
if (projectFile.fetchInfo().exists()) {
projectFile.delete(EFS.NONE, null);
}
}
}
代码示例来源:origin: org.eclipse.scout.sdk.deps/org.eclipse.jdt.ui
private boolean projectFolderAlreadyExists(String newName) throws CoreException {
boolean isNotInWorkpace= fProject.getProject().getDescription().getLocationURI() != null;
if (isNotInWorkpace)
return false; // projects outside of the workspace are not renamed
URI locationURI= fProject.getProject().getLocationURI();
IFileStore projectStore= EFS.getStore(locationURI);
if (!projectStore.getFileSystem().isCaseSensitive() && newName.equalsIgnoreCase(fProject.getElementName()))
return false; // allow to change case
IFileStore newProjectStore= projectStore.getParent().getChild(newName);
return newProjectStore.fetchInfo().exists();
}
内容来源于网络,如有侵权,请联系作者删除!