Package org.eclipse.core.runtime

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


    for (Enumeration zipEntries = zipFile.entries();
        zipEntries.hasMoreElements();) {
      ZipEntry zipEntry = (ZipEntry)zipEntries.nextElement();
      IPath entryPath = new Path(zipEntry.getName());
      if (entryPath.segmentCount() <= pathLength) {
        // ancestor or current directory
        continue;
      }
     
      if (!filePath.isPrefixOf(entryPath)) {
View Full Code Here


      if (!filePath.isPrefixOf(entryPath)) {
        // Not a descendant.
        continue;
      }
     
      if (entryPath.segmentCount() == pathLength + 1) {
        childZipEntries.put(zipEntry.getName(), zipEntry);
      } else {
        String name = entryPath.uptoSegment(pathLength + 1).
          addTrailingSeparator().toString();
       
View Full Code Here

   
    if (sourceFolder != null) {
      path = sourceFolder.getProjectRelativePath().append(path);
    }

    for (int ii = 1; ii <= path.segmentCount(); ii++) {
      IPath subpath = path.uptoSegment(ii);
      IFolder subfolder = project.getFolder(subpath);
     
      if (subfolder.exists() == false) {
        subfolder.create(true, true, monitor);
View Full Code Here

    }

    if (baselocation != null) {
      IWorkspaceRoot root = ResourcesPlugin.getWorkspace().getRoot();
      IPath filePath = new Path(baselocation);
      if (filePath.segmentCount() > 0) {
        resource = root.getFile(filePath);
      }
    }
    return resource;
  }
View Full Code Here

  public static IFile getFile(final String filename) {
    IFile file = null;

    if (filename != null) {
      final IPath filePath = new Path(filename);
      if ((filePath.segmentCount() > 1) && (ResourcesPlugin.getWorkspace().getRoot().getFile(filePath).exists())) {
        return ResourcesPlugin.getWorkspace().getRoot().getFile(filePath);
      }
      final IFile[] files = ResourcesPlugin.getWorkspace().getRoot().findFilesForLocationURI(URIUtil.toURI(filePath.makeAbsolute()));
      for (int i = 0; (i < files.length) && (file == null); ++i) {
        if (files[i].exists()) {
View Full Code Here

  private IFile getFile(IStructuredModel model) {
    IFile result = null;
    String location = model.getBaseLocation();
    if (location != null) {
      IPath path = new Path(location);
      if (path.segmentCount() > 1) {
        result = ResourcesPlugin.getWorkspace().getRoot().getFile(path);
      }
    }
    return result;
  }
View Full Code Here

            // TODO: URI validation?
            if (false && actualValue.indexOf('#') < 0 && actualValue.indexOf(":/") == -1 && CMUtil.isHTML(edec)) { //$NON-NLS-1$ //$NON-NLS-2$
              IStructuredDocumentRegion start = ((IDOMNode) node).getStartStructuredDocumentRegion();
              if (start != null && start.getFirstRegion().getTextLength() == 1) {
                IPath basePath = new Path(((IDOMNode) node).getModel().getBaseLocation());
                if (basePath.segmentCount() > 1) {
                  IPath path = ModuleCoreSupport.resolve(basePath, actualValue);
                  IResource found = ResourcesPlugin.getWorkspace().getRoot().findMember(path);
                  if (found == null || !found.isAccessible()) {
                    rgnType = REGION_VALUE;
                    state = ErrorState.RESOURCE_NOT_FOUND;
View Full Code Here

    if (node instanceof IDOMNode) {
      IStructuredModel model = ((IDOMNode) node).getModel();
      String baseLocation = model.getBaseLocation();
      if (!baseLocation.equals(IModelManager.UNMANAGED_MODEL)) {
        IPath path = new Path(baseLocation);
        if (path.segmentCount() > 1) {
          IProject project = ResourcesPlugin.getWorkspace().getRoot().getProject(path.segment(0));
          if (project.isAccessible()) {
            String key = createPreferenceKey(path);
            IEclipsePreferences preferences = new ProjectScope(project).getNode(JSPCorePlugin.getDefault().getBundle().getSymbolicName());
            type = preferences.get(key, DEFAULT_MIMETYPE);
View Full Code Here

  private IFile getFile(IStructuredModel model) {
    if (model != null) {
      String location = model.getBaseLocation();
      if (location != null) {
        IPath path = new Path(location);
        if (!path.toFile().exists() && path.segmentCount() > 1) {
          return ResourcesPlugin.getWorkspace().getRoot().getFile(path);
        }
      }
    }
    return null;
View Full Code Here

  private IFile getFile(IStructuredModel model) {
    IFile result = null;
    String location = model.getBaseLocation();
    if (location != null) {
      IPath path = new Path(location);
      if (path.segmentCount() > 1) {
        result = ResourcesPlugin.getWorkspace().getRoot().getFile(path);
      }
    }
    return result;
  }
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.