@Override public URI getURI() { return file.getLocationURI(); }
@Override public URI getURI() { return file.getLocationURI(); }
/** * Create an ICompilationUnit info from the given compilation unit on disk. */ protected ICompilationUnit createCompilationUnitFromPath(Openable handle, IFile file) { final char[] elementName = handle.getElementName().toCharArray(); return new ResourceCompilationUnit(file, file.getLocationURI()) { public char[] getFileName() { return elementName; } }; } /**
/** * Create an ICompilationUnit info from the given compilation unit on disk. */ protected ICompilationUnit createCompilationUnitFromPath(Openable handle, IFile file) { final char[] elementName = handle.getElementName().toCharArray(); return new ResourceCompilationUnit(file, file.getLocationURI()) { public char[] getFileName() { return elementName; } }; } /**
/** * Create an ICompilationUnit info from the given compilation unit on disk. */ protected ICompilationUnit createCompilationUnitFromPath(Openable handle, IFile file) { final char[] elementName = handle.getElementName().toCharArray(); return new ResourceCompilationUnit(file, file.getLocationURI()) { public char[] getFileName() { return elementName; } }; } /**
ClasspathJar(IFile resource, AccessRuleSet accessRuleSet) { this.resource = resource; try { java.net.URI location = resource.getLocationURI(); if (location == null) { this.zipFilename = ""; //$NON-NLS-1$ } else { File localFile = Util.toLocalFile(location, null); this.zipFilename = localFile.getPath(); } } catch (CoreException e) { // ignore } this.zipFile = null; this.knownPackageNames = null; this.accessRuleSet = accessRuleSet; }
ClasspathJar(IFile resource, AccessRuleSet accessRuleSet) { this.resource = resource; try { java.net.URI location = resource.getLocationURI(); if (location == null) { this.zipFilename = ""; //$NON-NLS-1$ } else { File localFile = Util.toLocalFile(location, null); this.zipFilename = localFile.getPath(); } } catch (CoreException e) { // ignore } this.zipFile = null; this.knownPackageNames = null; this.accessRuleSet = accessRuleSet; }
ClasspathJar(IFile resource, AccessRuleSet accessRuleSet) { this.resource = resource; try { java.net.URI location = resource.getLocationURI(); if (location == null) { this.zipFilename = ""; //$NON-NLS-1$ } else { File localFile = Util.toLocalFile(location, null); this.zipFilename = localFile.getPath(); } } catch (CoreException e) { // ignore } this.zipFile = null; this.knownPackageNames = null; this.accessRuleSet = accessRuleSet; }
/** * @deprecated Will be removed in a future release. Use {@link RenamingsManager#performRenamings(java.io.File)} instead. */ @Deprecated public void performRenamings(IFile file) { getRenamingsManager().performRenamings(Paths.get(file.getLocationURI())); }
IFile file = ...; // gets URI for EFS. URI uri = file.getLocationURI(); // what if file is a link, resolve it. if(file.isLinked()){ uri = file.getRawLocationURI(); } // Gets native File using EFS File javaFile = EFS.getStore(uri).toLocalFile(0, new NullProgressMonitor());
public URI getURI() { if (file != null) return file.getLocationURI(); return URIUtil.toURI(state.getFullPath()); }
@Override public URI getURI() { if (file != null) return file.getLocationURI(); return URIUtil.toURI(state.getFullPath()); }
/** * Returns a list or errors if validation fails. * * This method accepts as input a swagger YAML document and validates it against the swagger JSON Schema. * * @param content * @param editorInput * current input * @return list or errors * @throws IOException * @throws ParserException */ public Set<SwaggerError> validate(JsonDocument document, IFileEditorInput editorInput) { URI baseURI = editorInput != null ? editorInput.getFile().getLocationURI() : null; return validate(document, baseURI); }
/** * Get the file store for the local file system path. * * @param string * @return IFileStore or <code>null</code> if there is a * {@link CoreException}. */ public static IFileStore getFileStore(String string) { Path location = new Path(string); //see if there is an existing resource at that location that might have a different file store IFile file = ResourcesPlugin.getWorkspace().getRoot().getFileForLocation(location); if (file != null) { return getFileStore(file.getLocationURI()); } return getFileStore(location.toFile().toURI()); }
public static Image getImage(String imageLocation) { IFile file = AspectJPlugin.getWorkspace().getRoot().getFile(new Path(imageLocation)); ImageDescriptor id; try { id = ImageDescriptor.createFromURL(file.getLocationURI().toURL()); return AspectJImages.instance().getRegistry().get(id); } catch (MalformedURLException e) { } return null; }
private Set<String> getTypes(IFolder folder, String filePath) throws InvalidXMLException, IOException { Set<String> types = new HashSet<String>(); IFile iFile = getFile(folder, filePath); URL url; try { url = iFile.getLocationURI().toURL(); ResourceManager resMgr = UIMAFramework.newDefaultResourceManager(); resMgr.setDataPath(folder.getLocation().toPortableString()); types = getTypes(url, resMgr); } catch (MalformedURLException e) { e.printStackTrace(); } return types; }
@Override public RefactoringStatus isValid(IProgressMonitor pm) throws CoreException { RefactoringStatus result = new RefactoringStatus(); IFile file = ResourcesPlugin.getWorkspace().getRoot().getFile(fPath); URI location = file.getLocationURI(); if (location == null) { result.addFatalError(NLS.bind(RefactoringMessages.CreateFileChange_1, file.getFullPath())); return result; } IFileInfo jFile = EFS.getStore(location).fetchInfo(); if (jFile.exists()) { result.addFatalError(NLS.bind(RefactoringMessages.CreateFileChange_2, file.getFullPath())); return result; } return result; }
public NameEnvironmentAnswer findClass(String sourceFileWithoutExtension, String qualifiedPackageName, String qualifiedSourceFileWithoutExtension) { SimpleLookupTable dirTable = directoryTable(qualifiedPackageName); if (dirTable != null && dirTable.elementSize > 0) { IFile file = (IFile) dirTable.get(sourceFileWithoutExtension); if (file != null) { return new NameEnvironmentAnswer(new ResourceCompilationUnit(file, file.getLocationURI()), null /* no access restriction */); } } return null; }
public NameEnvironmentAnswer findClass(String sourceFileWithoutExtension, String qualifiedPackageName, String qualifiedSourceFileWithoutExtension) { SimpleLookupTable dirTable = directoryTable(qualifiedPackageName); if (dirTable != null && dirTable.elementSize > 0) { IFile file = (IFile) dirTable.get(sourceFileWithoutExtension); if (file != null) { return new NameEnvironmentAnswer(new ResourceCompilationUnit(file, file.getLocationURI()), null /* no access restriction */); } } return null; }
public NameEnvironmentAnswer findClass(String sourceFileWithoutExtension, String qualifiedPackageName, String qualifiedSourceFileWithoutExtension) { SimpleLookupTable dirTable = directoryTable(qualifiedPackageName); if (dirTable != null && dirTable.elementSize > 0) { IFile file = (IFile) dirTable.get(sourceFileWithoutExtension); if (file != null) { return new NameEnvironmentAnswer(new ResourceCompilationUnit(file, file.getLocationURI()), null /* no access restriction */); } } return null; }