Examples of matchingFirstSegments()


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

                        IContainer designContainer = _runtime.getConnectedDesignContainers().get(_webApplication);
                        designContainer.accept(new IResourceVisitor() {

                            public boolean visit(IResource resource) throws CoreException {
                                IPath remotePathObj = resource.getLocation();
                                int count = remotePathObj.matchingFirstSegments(_runtime.getDesignRoot().getLocation());
                                remotePathObj = remotePathObj.removeFirstSegments(count);
                                String remotePath = remotePathObj.toString();
                                if (resource.getType() == IResource.FILE) {
                                    DataSource content = new FileDataSource(((IFile) resource).getLocation().toFile());
                                    try {
View Full Code Here

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

        IPackageFragmentRoot root = this.packageFragmentRoots[i];
        if (!root.isExternal()) {
          continue;
        }
        IPath rootPath = root.getPath();
        int matchingCount = rootPath.matchingFirstSegments(path);
        if (matchingCount != 0) {
          String name = path.toOSString();
          // + 1 is for the File.separatorChar
          name = name.substring(rootPath.toOSString().length() + 1, name.length());
          name = name.replace(File.separatorChar, '.');
View Full Code Here

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

        boolean directory = path.charAt(path.length()-1)=='/';
       
        String[] segments = a.segments();
        IPath me = new Path(this.file.getAbsolutePath());
        IVResource parent = this;
        for (int i = me.matchingFirstSegments(a); i < segments.length; i++) {
            int segsToEnd = segments.length - i - 1;
            IStorage f = file.newInstance(a.removeLastSegments(segsToEnd).toString());
           
            if((i+1==segments.length) && directory)
              f.mkdir();
View Full Code Here

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

  }
  */
  public boolean isValid(String path){
     IPath workspaceRoot = new Path(this.userDirectory.getAbsolutePath());
     IPath a = new Path(path);
       if (a.matchingFirstSegments(workspaceRoot) != workspaceRoot.segmentCount()) {
           return false;
        }
       return true;
  }
 
View Full Code Here

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

              }
          }
          String[] segments = a.segments();
          IPath me = new Path(this.userDirectory.getAbsolutePath());
          IVResource parent = this.workspace;
          for (int i = me.matchingFirstSegments(a); i < segments.length; i++) {
              int segsToEnd = segments.length - i - 1;
              String s = a.removeLastSegments(segsToEnd).toOSString();
              IStorage f = this.userDirectory.newInstance(s);
              parent = new VFile(f, parent, segments[i]);
          }
View Full Code Here

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

            }
            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.matchingFirstSegments()

 
    IPath dataLocation = WorkbenchPlugin.getDefault().getDataLocation();
 
    if (dataLocation == null)
      return null;
    int segmentsToRemove = dataLocation
        .matchingFirstSegments(currentWorkspaceRoot);
 
    // Strip it down to the extension
    dataLocation = dataLocation.removeFirstSegments(segmentsToRemove);
    // Now add in the
View Full Code Here

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

        IPath policySourcePath = new Path(policySource).makeAbsolute();

        IPath projectRelativePath = fullPath.removeFirstSegments(1).makeAbsolute();

        String name = null;
        if (projectRelativePath.matchingFirstSegments(policySourcePath) ==
                policySourcePath.segmentCount()) {
            IPath relativePath = projectRelativePath.removeFirstSegments(
                    policySourcePath.segmentCount());
            name = makeAbsolute(relativePath.toString());
        }
View Full Code Here

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

    IPath webContentPath = ComponentCore.createComponent(getProject()).getRootFolder().getUnderlyingFolder().getFullPath();
        final IWorkspaceContextResolver wkspaceResolver =
            IStructuredDocumentContextResolverFactory.INSTANCE.getWorkspaceContextResolver( getStructuredDocumentContext() );
        IResource resource = wkspaceResolver.getResource();
        IPath filePath = resource.getFullPath();
    if (filePath.matchingFirstSegments(webContentPath) == webContentPath.segmentCount()) {
      filePath = filePath.removeFirstSegments(webContentPath.segmentCount());
      filePath = filePath.removeLastSegments(1);
      filePath = filePath.append(value);
      IVirtualFile file = getWebRoot().getFile(filePath);
      if (!file.exists()){
View Full Code Here

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

            return true;
          }
        } else {
          IPath webContentPath = webRoot.getUnderlyingFolder().getFullPath();
          IPath filePath = jsp.getFullPath();
          if (filePath.matchingFirstSegments(webContentPath) == webContentPath.segmentCount()) {
            String extension = filePath.getFileExtension();
            filePath = filePath.removeFirstSegments(webContentPath.segmentCount());
            filePath = filePath.removeLastSegments(1);
            filePath = filePath.append(value);
            if (filePath.getFileExtension() == null && extension != null) {
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.