private static IFile getFileHandle(IPath propertyFilePath) { if (propertyFilePath == null) return null; return ResourcesPlugin.getWorkspace().getRoot().getFile(propertyFilePath); }
private IResource[] getResources(GitModelBlob modelBlob) { IFile file = ROOT.getFileForLocation(modelBlob.getLocation()); if (file == null) file = ROOT.getFile(modelBlob.getLocation()); return new IResource[] { file }; }
private static IFile getFileHandle(IPath propertyFilePath) { if (propertyFilePath == null) return null; return ResourcesPlugin.getWorkspace().getRoot().getFile(propertyFilePath); }
protected IFile getOldFile(IProgressMonitor pm) throws OperationCanceledException { pm.beginTask("", 1); //$NON-NLS-1$ try { return ResourcesPlugin.getWorkspace().getRoot().getFile(fPath); } finally { pm.done(); } }
protected IFile getOldFile(IProgressMonitor pm) throws OperationCanceledException { pm.beginTask("", 1); //$NON-NLS-1$ try { return ResourcesPlugin.getWorkspace().getRoot().getFile(fPath); } finally { pm.done(); } }
protected IFile getOldFile(IProgressMonitor pm) throws OperationCanceledException { pm.beginTask("", 1); //$NON-NLS-1$ try { return ResourcesPlugin.getWorkspace().getRoot().getFile(fPath); } finally { pm.done(); } }
private IFile getIFile (Resource resource) { IWorkspaceRoot workspaceRoot = ResourcesPlugin.getWorkspace().getRoot(); String fileString = getResourcePath(resource); if (fileString != null && !fileString.equals(BLANK)) { return workspaceRoot.getFile(new Path(fileString)); } return null; }
@Override public void deleteFile(String fileName) { try { IFile file = root.getFile(new Path(fileName)); file.delete(true, new NullProgressMonitor()); } catch (CoreException e) { throw new RuntimeException(e); } }
public static String getEncoding(String workspacePath) { try { return ResourcesPlugin.getWorkspace().getRoot().getFile(new Path(workspacePath)).getCharset(); } catch (CoreException exception) { return null; } }
/** * @param path full absolute workspace path */ private static boolean isInternalFilePath(IPath path) { IWorkspaceRoot wsRoot = ResourcesPlugin.getWorkspace().getRoot(); // in case this is full workspace path it should start with project segment if(path.segmentCount() > 1 && wsRoot.getFile(path).exists()) { return true; } return false; }
private void addFile(Set<IAdaptable> selectedElements, Element element) throws IOException { IPath path= getPath(element); if (path != null) { IFile file= JavaPlugin.getWorkspace().getRoot().getFile(path); if (file != null) selectedElements.add(file); } }
public static void delete(String platformResourcePath, Map<?, ?> options) throws IOException { IFile file = workspaceRoot.getFile(new Path(platformResourcePath)); try { file.delete(true, null); } catch (CoreException exception) { throw new Resource.IOWrappedException(exception); } }
private IResource internalGetResource(IPath fullPath, boolean container) { if (container) { if (fullPath.segmentCount() == 1) return ResourcesPlugin.getWorkspace().getRoot().getProject(fullPath.segment(0)); return ResourcesPlugin.getWorkspace().getRoot().getFolder(fullPath); } return ResourcesPlugin.getWorkspace().getRoot().getFile(fullPath); }
public static boolean validateEdit(String workspacePath, Monitor monitor) { IFile file = ResourcesPlugin.getWorkspace().getRoot().getFile(new Path(workspacePath)); return file.getWorkspace().validateEdit(new IFile [] { file }, IWorkspace.VALIDATE_PROMPT).isOK(); }
public static void setWriteable(String path) throws Exception { IFile file = ResourcesPlugin.getWorkspace().getRoot().getFile(new Path(path)); ResourceAttributes resourceAttributes = file.getResourceAttributes(); if (resourceAttributes != null) { resourceAttributes.setReadOnly(false); file.setResourceAttributes(resourceAttributes); } } }
private IPathVariableManager getManager(IPath workspacePath) { IWorkspaceRoot workspaceRoot = ResourcesPlugin.getWorkspace().getRoot(); IResource resource = workspaceRoot.findMember(workspacePath); if (resource != null) return resource.getPathVariableManager(); return workspaceRoot.getFile(workspacePath).getPathVariableManager(); }
private IPathVariableManager getManager(IPath workspacePath) { IWorkspaceRoot workspaceRoot = ResourcesPlugin.getWorkspace().getRoot(); IResource resource = workspaceRoot.findMember(workspacePath); if (resource != null) return resource.getPathVariableManager(); return workspaceRoot.getFile(workspacePath).getPathVariableManager(); }
/** * Gets the description file (as workspace resource). * * @return a file which points to the description */ public IFile getDescriptionFile() { IPath path= getDescriptionLocation(); if (path.isValidPath(path.toString()) && path.segmentCount() >= 2) return JavaPlugin.getWorkspace().getRoot().getFile(path); else return null; }
/** * Gets the description file (as workspace resource). * * @return a file which points to the description */ public IFile getDescriptionFile() { IPath path= getDescriptionLocation(); if (path.isValidPath(path.toString()) && path.segmentCount() >= 2) return JavaPlugin.getWorkspace().getRoot().getFile(path); else return null; }
@Override protected void folderToFile(UnifiedTreeNode node, Resource target) { // Pass correct gender to changed for notification and async-refresh changed((Resource) workspace.getRoot().getFile(target.getFullPath())); } }