Examples of removeFirstSegments()


Examples of org.eclipse.core.runtime.IPath.removeFirstSegments()

            }
            if(!includeLibs && files[i] instanceof VLibraryResource)
              continue;

          IPath filePath = new Path(files[i].getPath());
            String pathString = filePath.removeFirstSegments(filePath.matchingFirstSegments(root)).toString();
           
            if(pathString==null) return;
           
            /* remove leading characters that confuse and anger windows built in archive util */
            if(pathString.length() > 1 && pathString.indexOf("./")==0)
View Full Code Here

Examples of org.eclipse.core.runtime.IPath.removeFirstSegments()

   * @return the image descriptor
   */
  public static ImageDescriptor findImageDescriptor(String path) {
    final IPath p = new Path(path);
    if (p.isAbsolute() && p.segmentCount() > 1) {
      return AbstractUIPlugin.imageDescriptorFromPlugin(p.segment(0), p
          .removeFirstSegments(1).makeAbsolute().toString());
    } else {
      return getBundledImageDescriptor(p.makeAbsolute().toString());
    }
  }
View Full Code Here

Examples of org.eclipse.core.runtime.IPath.removeFirstSegments()

        // TODO try to preselect the current file
        dialog.open();
        Object[] results = dialog.getResult();
        if ((results != null) && (results.length > 0) && (results[0] instanceof IResource)) {
            IPath path = ((IResource) results[0]).getFullPath();
            setProjectLoc(path.removeFirstSegments(1).makeRelative().toString());
        }
    }

    private void selectInWorkspace() {
        ElementTreeSelectionDialog dialog = new ElementTreeSelectionDialog(getShell(),
View Full Code Here

Examples of org.eclipse.core.runtime.Path.removeFirstSegments()

    for (int i = 0; i < max; i++) {
      String resName = resNames[i];
      // consider that a .java file is not a non-java resource (see bug 12246 Packages view shows .class and .java files when JAR has source)
      if (!Util.isJavaLikeFileName(resName)) {
        IPath filePath = new Path(resName);
        IPath childPath = filePath.removeFirstSegments(this.names.length);
        JarEntryFile file = new JarEntryFile(filePath.lastSegment());
        jarEntries.put(childPath, file);
        if (childPath.segmentCount() == 1) {
          file.setParent(pkg);
          topJarEntries.add(file);
View Full Code Here

Examples of org.eclipse.core.runtime.Path.removeFirstSegments()

      File file = files[i];
      if (file.isDirectory()) {
        hasSubDirectories = true;
        if (firstLevelPackageNames.contains(file.getName())) {
          IPath fullPath = new Path(file.getParentFile().getPath());
          IPath rootPathEntry = fullPath.removeFirstSegments(this.sourcePath.segmentCount()).setDevice(null);
          set.add(rootPathEntry);
          break loop;
        } else {
          computeRootPath(file, firstLevelPackageNames, hasDefaultPackage, set);
        }
View Full Code Here

Examples of org.eclipse.core.runtime.Path.removeFirstSegments()

        }
      } else if (i == max - 1 && !hasSubDirectories && hasDefaultPackage) {
        File parentDir = file.getParentFile();
        if (parentDir.list(FILENAME_FILTER).length != 0) {
          IPath fullPath = new Path(parentDir.getPath());
          IPath rootPathEntry = fullPath.removeFirstSegments(this.sourcePath.segmentCount()).setDevice(null);
          set.add(rootPathEntry);
        }
      }
    }
  } 
View Full Code Here

Examples of org.eclipse.core.runtime.Path.removeFirstSegments()

        final IWorkspace workspace = ResourcesPlugin.getWorkspace();
        final IWorkspaceRoot workspaceRoot = workspace.getRoot();
        IPath workspacePath = workspaceRoot.getLocation();

        if (workspacePath.isPrefixOf(path)) {
            final IPath relativePath = path.removeFirstSegments(workspacePath.segmentCount());
            IResource resource;
            if (file.isDirectory()) {
                resource = workspaceRoot.getFolder(relativePath);
            } else {
                resource = workspaceRoot.getFile(relativePath);
View Full Code Here

Examples of org.eclipse.core.runtime.Path.removeFirstSegments()

   */
  public IStorage create(String name) {
    IPath path = new Path(name);
    VOrionStorage parent = (VOrionStorage) this.createProject(path.segment(0));
    if (path.segmentCount() > 1) {
      return parent.create(path.removeFirstSegments(1).toString());
    }
    return parent;
  }

  public void mkdir() throws IOException {
View Full Code Here

Examples of org.eclipse.core.runtime.Path.removeFirstSegments()

    IPath path = new Path(pathInfo);
    if ( path.hasTrailingSeparator() ) {
      path = path.removeTrailingSeparator();
    }

    path = path.removeFirstSegments(1);
    String userName = path.segment(0);
    if ( path.segmentCount() < 4 || !path.segment(1).equals("ws") || !path.segment(2).equals("workspace") ) {
      theLogger.warning("incorrectly formed workspace path: " + path);
      resp.sendError(HttpServletResponse.SC_BAD_REQUEST);
      return;
View Full Code Here

Examples of org.eclipse.core.runtime.Path.removeFirstSegments()

    if ( path.segmentCount() < 4 || !path.segment(1).equals("ws") || !path.segment(2).equals("workspace") ) {
      theLogger.warning("incorrectly formed workspace path: " + path);
      resp.sendError(HttpServletResponse.SC_BAD_REQUEST);
      return;
    }
    path = path.removeFirstSegments(3);

    /* unlocking user directory to un-authenticated users */
    try {
      if ( user == null ) {
        user = ServerManager.getServerManager().getUserManager().getUser(userName);
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.