Examples of removeFirstSegments()


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

    if (this.entryKind != IClasspathEntry.CPE_VARIABLE && this.entryKind != IClasspathEntry.CPE_CONTAINER) {
      // translate to project relative from absolute (unless a device path)
      if (xmlPath.isAbsolute()) {
        if (projectPath != null && projectPath.isPrefixOf(xmlPath)) {
          if (xmlPath.segment(0).equals(projectPath.segment(0))) {
            xmlPath = xmlPath.removeFirstSegments(1);
            xmlPath = xmlPath.makeRelative();
          } else {
            xmlPath = xmlPath.makeAbsolute();
          }
        }
View Full Code Here

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

    if (this.sourceAttachmentPath != null) {
      xmlPath = this.sourceAttachmentPath;
      // translate to project relative from absolute
      if (this.entryKind != IClasspathEntry.CPE_VARIABLE && projectPath != null && projectPath.isPrefixOf(xmlPath)) {
        if (xmlPath.segment(0).equals(projectPath.segment(0))) {
          xmlPath = xmlPath.removeFirstSegments(1);
          xmlPath = xmlPath.makeRelative();
        }
      }
      parameters.put(TAG_SOURCEPATH, String.valueOf(xmlPath));
    }
View Full Code Here

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

              if (equalsOneOf(path, nestedFolders)) {
                // nested source folder
                return false;
              } else {
                // folder containing nested source folder
                IFolder folder = destFolder.getFolder(path.removeFirstSegments(sourceSegmentCount));
                if ((updateModelFlags & IPackageFragmentRoot.REPLACE) != 0
                    && folder.exists()) {
                  return true;
                }
                folder.create(updateResourceFlags, true, progressMonitor);
View Full Code Here

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

              if (equalsOneOf(path, nestedFolders)) {
                // nested source folder
                return false;
              } else {
                // folder containing nested source folder
                IFolder folder = destFolder.getFolder(path.removeFirstSegments(sourceSegmentCount));
                if ((updateModelFlags & IPackageFragmentRoot.REPLACE) != 0
                    && folder.exists()) {
                  return true;
                }
                folder.create(updateResourceFlags, true, progressMonitor);
View Full Code Here

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

                if (results == null) {
                    return;
                }

                IPath selectedPath = (IPath) results[0];
                folderText.setText(selectedPath.removeFirstSegments(1).toString());
            }
        });

        Dialog.applyDialogFont(c);
View Full Code Here

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

            Object[] files = dialog.getResult();
            List<IPath> added = new ArrayList<IPath>(files.length);
            for (Object file : files) {
                IPath newPath = ((IResource) file).getFullPath().makeRelative();
                // Remove the first segment (project name)
                newPath = newPath.removeFirstSegments(1);
                added.add(newPath);
            }
            if (!added.isEmpty()) {
                classPath.addAll(added);
                viewer.add(added.toArray(new IPath[added.size()]));
View Full Code Here

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

            Object[] folders = dialog.getResult();
            List<IPath> added = new ArrayList<IPath>(folders.length);
            for (Object folder : folders) {
                IPath newPath = ((IResource) folder).getFullPath().makeRelative().addTrailingSeparator();
                // Remove the first segment (project name)
                newPath = newPath.removeFirstSegments(1);
                added.add(newPath);
            }
            if (!added.isEmpty()) {
                classPath.addAll(added);
                viewer.add(added.toArray(new IPath[added.size()]));
View Full Code Here

Examples of org.eclipse.core.runtime.IPath.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.IPath.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.IPath.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.