protected IFile primGetFile(IContainer container, IPath path) { try { return container.getFile(path); } catch (IllegalArgumentException ex) { } return null; }
protected IResource findOriginalResource(IPath partialPath) { for (int i = 0, l = this.sourceLocations.length; i < l; i++) { ClasspathMultiDirectory sourceLocation = this.sourceLocations[i]; if (sourceLocation.hasIndependentOutputFolder) { IResource originalResource = sourceLocation.sourceFolder.getFile(partialPath); if (originalResource.exists()) return originalResource; } } return null; }
protected IResource findOriginalResource(IPath partialPath) { for (int i = 0, l = this.sourceLocations.length; i < l; i++) { ClasspathMultiDirectory sourceLocation = this.sourceLocations[i]; if (sourceLocation.hasIndependentOutputFolder) { IResource originalResource = sourceLocation.sourceFolder.getFile(partialPath); if (originalResource.exists()) return originalResource; } } return null; }
/** * Returns a file relative to the bundle root of the specified project. * * @param project project * @param path bundle root relative path * @return file that may or may not exist */ public static IFile getBundleRelativeFile(IProject project, IPath path) { return getBundleRoot(project).getFile(path); }
protected IResource findOriginalResource(IPath partialPath) { for (int i = 0, l = this.sourceLocations.length; i < l; i++) { ClasspathMultiDirectory sourceLocation = this.sourceLocations[i]; if (sourceLocation.hasIndependentOutputFolder) { IResource originalResource = sourceLocation.sourceFolder.getFile(partialPath); if (originalResource.exists()) return originalResource; } } return null; }
protected IResource findOriginalResource(IPath partialPath) { for (int i = 0, l = this.sourceLocations.length; i < l; i++) { ClasspathMultiDirectory sourceLocation = this.sourceLocations[i]; if (sourceLocation.hasIndependentOutputFolder) { IResource originalResource = sourceLocation.sourceFolder.getFile(partialPath); if (originalResource.exists()) return originalResource; } } return null; }
protected IResource findOriginalResource(IPath partialPath) { for (int i = 0, l = this.sourceLocations.length; i < l; i++) { ClasspathMultiDirectory sourceLocation = this.sourceLocations[i]; if (sourceLocation.hasIndependentOutputFolder) { IResource originalResource = sourceLocation.sourceFolder.getFile(partialPath); if (originalResource.exists()) return originalResource; } } return null; }
private IResource getResourceChild(IResource parent, String childName, boolean isContainer) { if (parent.getType() == IResource.FILE) { return null; } if (isContainer) { return ((IContainer) parent).getFolder(new Path(null, childName)); } else { return ((IContainer) parent).getFile(new Path(null, childName)); } }
public IResource resource(PackageFragmentRoot root) { if (root == null) return null; // working copy not in workspace return ((IContainer) ((Openable) this.parent).resource(root)).getFile(new Path(getElementName())); } /**
@Override public IResource resource(PackageFragmentRoot root) { if (root == null) return null; // working copy not in workspace return ((IContainer) ((Openable) this.parent).resource(root)).getFile(new Path(getElementName())); } /**
protected void okPressed() { IFile file = wsSelectedContainer.getFile(new Path( wsFilenameText.getText())); if (file != null) wsPathText.setText(file.getFullPath().toString()); validatePage(); super.okPressed(); }
@Override public IResource resource(PackageFragmentRoot root) { return ((IContainer) ((Openable) this.parent).resource(root)).getFile(new Path(getElementName())); } /**
public IResource resource(PackageFragmentRoot root) { if (root == null) return null; // working copy not in workspace return ((IContainer) ((Openable) this.parent).resource(root)).getFile(new Path(getElementName())); } /**
@Override public IResource resource(PackageFragmentRoot root) { return ((IContainer) ((Openable) this.parent).resource(root)).getFile(new Path(getElementName())); } /**
public IResource resource(PackageFragmentRoot root) { if (root == null) return null; // working copy not in workspace return ((IContainer) ((Openable) this.parent).resource(root)).getFile(new Path(getElementName())); } /**
protected @Nullable IStorage getGeneratedFileForTraceFile(IStorage traceFile) { if (traceFile instanceof IFile) { IFile file = (IFile) traceFile; String lastSegment = traceFile.getFullPath().lastSegment(); lastSegment = traceFileNameProvider.getJavaFromTrace(lastSegment); return file.getParent().getFile(new Path(lastSegment)); } return null; }
/** * @since 2.3 */ public @Nullable IStorage getTraceFile(IStorage storage) { if (storage instanceof IFile) { IFile file = (IFile) storage; String originLastSegment = file.getFullPath().lastSegment(); IFile traceFile = file.getParent().getFile(new Path(traceFileNameProvider.getTraceFromJava(originLastSegment))); return traceFile; } return null; }
private void copyFile(String fileName, InputStream input, IContainer dst, boolean binary, IProgressMonitor monitor) throws CoreException { monitor.subTask(fileName); IFile dstFile = dst.getFile(new Path(fileName)); try (InputStream stream = getProcessedStream(fileName, input, binary)) { if (dstFile.exists()) { dstFile.setContents(stream, true, true, monitor); } else { dstFile.create(stream, true, monitor); } } catch (IOException e) { } }
protected void createManifest(IProject project, IContainer aFolder, IProgressMonitor monitor) throws CoreException, InvocationTargetException, InterruptedException { IFile file = aFolder.getFile(new Path(J2EEConstants.MANIFEST_URI)); if (file.exists()) return; try { ManifestFileCreationAction.createManifestFile(file, project); } catch (CoreException e) { Logger.getLogger().log(e); } catch (IOException e) { Logger.getLogger().log(e); } }