Examples of segment()


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

    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.segment()

      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;
    }
    path = path.removeFirstSegments(3);
View Full Code Here

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

      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;
    }
    path = path.removeFirstSegments(3);
View Full Code Here

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

  private boolean containsPublishedFiles(IStorage dir, IDesignerUser user, String timeStamp){
    for(Version version : user.getVersions()){
      if(!version.getTime().equals(timeStamp)) continue;
      for(String res : version.resources){
        IPath resPath = new Path(res);
        while(resPath.segment(0).equals(".")) resPath = resPath.removeFirstSegments(1);
        if(dir.getName().equals(resPath.segment(0))){
          return true;
        }
      }
    }
View Full Code Here

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

    for(Version version : user.getVersions()){
      if(!version.getTime().equals(timeStamp)) continue;
      for(String res : version.resources){
        IPath resPath = new Path(res);
        while(resPath.segment(0).equals(".")) resPath = resPath.removeFirstSegments(1);
        if(dir.getName().equals(resPath.segment(0))){
          return true;
        }
      }
    }
    return false;
View Full Code Here

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

    public IVResource[] findChildren(String childName) {
        // TODO Auto-generated method stub
        Path path = new Path(childName);
        IOFileFilter filter;
        if (path.segment(0).equals("*")) {
            filter = new NameFileFilter(path.lastSegment());
        } else {
            String lastSegment = path.lastSegment();
            if (lastSegment.startsWith("*")) {
                filter = new SuffixFileFilter(lastSegment.substring(1));
View Full Code Here

Examples of org.eclipse.emf.common.util.URI.segment()

    // uri can be platform-specific or not ...
    if (oFileURI.isPlatform()) {
      // leaving out the first ("resource") and the last (the file name)
      StringBuffer sLocalDirectory = new StringBuffer();
      for (int i = 1; i < oFileURI.segmentCount() - 1; ++i) {
        sLocalDirectory.append(oFileURI.segment(i) + "/");
      }

      Configuration.setLocalSourceDirectory(sLocalDirectory.toString());
      Configuration.setWorkspacePath(ResourcesPlugin.getWorkspace()
          .getRoot().getLocation().toString()
View Full Code Here

Examples of org.eclipse.sapphire.Version.segment()

        Version version;
       
        version = new Version( "1.2.3.0" );

        assertEquals( 3, version.length() );
        assertEquals( 1l, version.segment( 0 ) );
        assertEquals( 2l, version.segment( 1 ) );
        assertEquals( 3l, version.segment( 2 ) );
        assertEquals( 0l, version.segment( 3 ) );
        assertEquals( 0l, version.segment( 1000 ) );
        assertEquals( list( 1l, 2l, 3l ), version.segments() );
View Full Code Here

Examples of org.eclipse.sapphire.modeling.ModelPath.segment()

                if( p != null )
                {
                    throw new RuntimeException( path.toString() );
                }
               
                final ModelPath.Segment segment = path.segment( i );
               
                if( segment instanceof ModelPath.ModelRootSegment )
                {
                    element = element.root();
                }
View Full Code Here

Examples of org.eclipse.sapphire.modeling.Path.segment()

            {
                final Path root = new Path( reference );
               
                if( root.segmentCount() == 1 )
                {
                    return wsroot.getProject( root.segment( 0 ) );
                }
                else
                {
                    return wsroot.getFolder( PathBridge.create( root ) );
                }
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.