@Override public IPath getProjectRelativePath() { if (this.resource == null) return null; return this.resource.getProjectRelativePath(); }
public IPath getProjectRelativePath() { if (this.resource == null) return null; return this.resource.getProjectRelativePath(); }
public IPath getProjectRelativePath() { if (this.resource == null) return null; return this.resource.getProjectRelativePath(); }
private boolean isMetaFile(IFile file) { String segment = file.getProjectRelativePath().toString(); return ProjectUtilities.DOT_CLASSPATH.equals(segment) || ProjectUtilities.DOT_PROJECT.equals(segment) || ".runtime".equals(segment) || segment.endsWith(IModuleConstants.COMPONENT_FILE_NAME) || segment.startsWith(".settings"); //$NON-NLS-1$ }
private String getMetaFileType(IFile file) { for (Iterator<String> iter = metaFilePaths.keySet().iterator(); iter.hasNext();) { String id = iter.next(); IPath[] paths = metaFilePaths.get(id); for (int i = 0; i < paths.length; i++) { IPath path = paths[i]; if (isSuffix(file.getProjectRelativePath(), path)) { return id; } } } return null; }
public InputStream getInputStream(IArchiveResource archiveResource) throws IOException, FileNotFoundException { IFile file = pathsToIFiles.get(archiveResource.getPath()); if (file != null) { try { return file.getContents(); } catch (CoreException core) { throw new IOException("Unable to get contents from " + file.getProjectRelativePath() + " message " + core.getLocalizedMessage()); } } throw new FileNotFoundException(archiveResource.getPath().toString()); }
/** * Suite file launcher. The <code>IFile</code> must exist in the workbench. */ public static void launchSuiteConfiguration(IFile suiteFile, String mode, ILaunchConfiguration prevConfig, Set<String> failureDescriptions) { final IProject project= suiteFile.getProject(); final String fileConfName= suiteFile.getProjectRelativePath().toString().replace('/', '.'); final String suitePath= suiteFile.getLocation().toOSString(); launchSuiteConfiguration(project, fileConfName, suitePath, mode, prevConfig, failureDescriptions); }
private String getRelativePath(IClasspathEntry cpe, IProject project) { IPath path = project.getFile(cpe.getPath()).getProjectRelativePath(); return path.removeFirstSegments(1).toString(); }
protected IPath getProjectRelativePath(IArchiveResource aFile) { if (null != nonStandardSourceFiles && nonStandardSourceFiles.containsKey(aFile)) { IPath path = nonStandardSourceFiles.get(aFile); IVirtualFolder rootFolder = vComponent.getRootFolder(); IVirtualFile vFile = rootFolder.getFile(path); IFile iFile = vFile.getUnderlyingFile(); return iFile.getProjectRelativePath(); } return super.getProjectRelativePath(aFile); }
@Override public boolean select(Viewer viewer, Object parent, Object element) { if (element instanceof IFolder) return isPathValid(((IFolder) element).getProjectRelativePath()); if (element instanceof IFile) return isFileValid(((IFile) element).getProjectRelativePath()); return false; } }
protected final IStatus createVirtualArchiveComponent(IProject targetProject, String uriMapping, IFile utilityJarIFile, IProgressMonitor monitor) throws InvocationTargetException, InterruptedException, ExecutionException { IDataModel addArchiveProjectToEARDataModel = DataModelFactory.createDataModel(new CreateReferenceComponentsDataModelProvider()); IVirtualComponent earcomponent = ComponentCore.createComponent(targetProject); IVirtualComponent utilcomponent = ComponentCore.createArchiveComponent(targetProject, VirtualArchiveComponent.LIBARCHIVETYPE + IPath.SEPARATOR + utilityJarIFile.getProjectRelativePath().toString()); addArchiveProjectToEARDataModel.setProperty(ICreateReferenceComponentsDataModelProperties.SOURCE_COMPONENT, earcomponent); addArchiveProjectToEARDataModel.setProperty(ICreateReferenceComponentsDataModelProperties.TARGET_COMPONENT_LIST, Collections.singletonList(utilcomponent)); Map uriMap = new HashMap(); uriMap.put(utilcomponent, uriMapping); addArchiveProjectToEARDataModel.setProperty(ICreateReferenceComponentsDataModelProperties.TARGET_COMPONENTS_TO_URI_MAP, uriMap); return addArchiveProjectToEARDataModel.getDefaultOperation().execute(monitor, null); }
public boolean acceptFile(IFile file) throws CoreException { IJavaElement element= JavaCore.create(file); if ((element != null && element.exists())) return false; // Only touch text files (see bug https://bugs.eclipse.org/bugs/show_bug.cgi?id=114153 ): if (! FileBuffers.getTextFileBufferManager().isTextFileLocation(file.getFullPath(), false)) return false; IPath path= file.getProjectRelativePath(); String segment= path.segment(0); if (segment != null && (segment.startsWith(".refactorings") || segment.startsWith(".deprecations"))) //$NON-NLS-1$ //$NON-NLS-2$ return false; return true; }
protected IClasspathEntry newClasspathEntryFromEARProj() { IPath path = earProject.getFullPath().append( getEarContentFolder() + IPath.SEPARATOR + earProject.getFile(getText()).getProjectRelativePath()); return JavaCore.newLibraryEntry(path, path, null, true); }
protected IPath getOutputPathForFile(File aFile) { if(endsWithClassType(aFile.getURI())){ return importedClassesFolder.getFile(getImportedClassesURI(aFile)).getProjectRelativePath(); } return super.getOutputPathForFile(aFile); }
private boolean isPomModified() { IMavenProjectFacade facade = getMavenProjectFacade(); IResourceDelta delta = getDelta(facade.getProject()); if (delta == null) { return false; } if (delta.findMember(facade.getPom().getProjectRelativePath()) != null) { return true; } return false; }
@Override protected IPath getProjectRelativePath(IArchiveResource aFile) { if (endsWithClassType(aFile.getPath().lastSegment())) { return importedClassesFolder.getFile(getImportedClassesURI(aFile)).getProjectRelativePath(); } return super.getProjectRelativePath(aFile); }
private DiffNode getFileParent(IDiffContainer root, IFile file) { String projectName = file.getProject().getName(); DiffNode child = getOrCreateChild(root, projectName, true); IPath path = file.getProjectRelativePath(); for (int i = 0; i < path.segmentCount() - 1; i++) child = getOrCreateChild(child, path.segment(i), false); return child; }
private void adjustBuildPropertiesFile(IFile underlyingResource) throws CoreException { IProject project = underlyingResource.getProject(); IFile buildPropertiesFile = PDEProject.getBuildProperties(project); if (buildPropertiesFile.exists()) { WorkspaceBuildModel model = new WorkspaceBuildModel(buildPropertiesFile); IBuildEntry entry = model.getBuild().getEntry(IBuildEntry.BIN_INCLUDES); String relativePath = underlyingResource.getProjectRelativePath().toString(); if (!entry.contains(relativePath)) { entry.addToken(relativePath); model.save(); } } }
private IPath getDiffPath(IFile file) { DiffProject project = getDiffProject(file.getProject()); if (project != null) { return file.getProjectRelativePath(); } return file.getFullPath().removeFirstSegments(getTarget().getFullPath().segmentCount()); }
private IPath getDiffPath(IFile file) { DiffProject project = getDiffProject(file.getProject()); if (project != null) { return file.getProjectRelativePath(); } return file.getFullPath().removeFirstSegments(getTarget().getFullPath().segmentCount()); }