Package org.eclipse.core.runtime

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


              if (childUri == null) {
                childUri = "WEB-INF/lib/" + child.getName(); //$NON-NLS-1$
              }
              IPath jarPath = new Path(childUri);
              File jarFile = new File(tempFile, jarPath.lastSegment());
              jarPath = jarPath.removeLastSegments(1);

              IModuleResource[] mr = server.getResources(new IModule[] { child });
              IStatus[] status = helper.publishToPath(mr, new Path(jarFile.getAbsolutePath()), monitor);
              merge(result, status);
              resources.add(new ModuleFile(jarFile, jarFile.getName(), jarPath));
View Full Code Here


              if (childUri == null) {
                childUri = "WEB-INF/lib/" + child.getName() + ".jar"; //$NON-NLS-1$ //$NON-NLS-2$
              }
              IPath jarPath = new Path(childUri);
              File jarFile = new File(tempFile, jarPath.lastSegment());
              jarPath = jarPath.removeLastSegments(1);

              IModuleResource[] mr = server.getResources(new IModule[] { child });
              IStatus[] status = helper.publishZip(mr, new Path(jarFile.getAbsolutePath()), monitor);
              merge(result, status);
              resources.add(new ModuleFile(jarFile, jarFile.getName(), jarPath));
View Full Code Here

      if (name == null)
        setErrorMessage("Debug Package File Path missing");
      else {
        Path path = new Path(name);
        File file = path.removeLastSegments(1).toFile();

        if (!path.isValidPath(name) || path.segmentCount() == 0
            || !file.exists())
          setErrorMessage("Debug Package File Path invalid");
      }
View Full Code Here

    private String getLibName(final String libDir) {
        final IPath p = new Path(libDir);
        String s = p.lastSegment();
        if ("ebin".equals(s)) {
            s = p.removeLastSegments(1).lastSegment();
        }
        final int dashPos = s.lastIndexOf('-');
        if (dashPos != -1) {
            return s.substring(0, dashPos);
        }
View Full Code Here

        final Map<IPath, String> paths = Maps.newHashMap();
        for (final OtpErlangObject ebeam : list) {
            final OtpErlangString beam = (OtpErlangString) ebeam;
            final String sbeam = beam.stringValue();
            IPath p = new Path(sbeam);
            p = p.removeLastSegments(1);
            p = p.removeFirstSegments(project.getLocation().segmentCount());
            p = p.setDevice(null);
            paths.put(p, sbeam);
        }
        for (final Entry<IPath, String> p : paths.entrySet()) {
View Full Code Here

            }
        }
        if (filePath != null) {
            final IPath path = new Path(filePath);
            IFileStore fileStore = EFS.getLocalFileSystem().getStore(
                    path.removeLastSegments(1));
            fileStore = fileStore.getChild(path.lastSegment());
            final IFileInfo fetchInfo = fileStore.fetchInfo();
            if (!fetchInfo.isDirectory() && fetchInfo.exists()) {
                if (element instanceof IErlModule
                        && element.getParent() instanceof IErlExternal) {
View Full Code Here

        final int n = ref.segmentCount();
        final List<String> result = Lists.newArrayList();
        for (final Iterator<String> iter = list.iterator(); iter.hasNext();) {
            final String element = iter.next();
            IPath p = new Path(element);
            p = p.removeLastSegments(1).removeFirstSegments(n).setDevice(null);
            String ps = p.toString();
            if ("".equals(ps)) {
                ps = ".";
            }
            if (result.indexOf(ps) < 0) {
View Full Code Here

 
  public Collection<IPath> justFolders(final Iterable<String> files) {
    final Function1<String, IPath> _function = new Function1<String, IPath>() {
      public IPath apply(final String it) {
        Path _path = new Path(it);
        return _path.removeLastSegments(1);
      }
    };
    Iterable<IPath> _map = IterableExtensions.<String, IPath>map(files, _function);
    return CollectionLiterals.<IPath>newLinkedHashSet(((IPath[])Conversions.unwrapArray(_map, IPath.class)));
  }
View Full Code Here

          pathString);
    } else {
      messageString = NLS
          .bind(
              PreferencesMessages.WizardDataTransfer_overwriteNameAndPathQuestion,
              path.lastSegment(), path.removeLastSegments(1)
                  .toOSString());
    }

    final MessageDialog dialog = new MessageDialog(getContainer()
        .getShell(), PreferencesMessages.Question, null, messageString,
View Full Code Here

      if (resource != null)
        rootInfo = (DeltaProcessor.RootInfo) rootInfos.get(resource.getLocation());
    } else {
      rootInfo = (DeltaProcessor.RootInfo) rootInfos.get(path);
      while (rootInfo == null && path.segmentCount() > 0) {
        path = path.removeLastSegments(1);
        rootInfo = (DeltaProcessor.RootInfo) rootInfos.get(path);
      }
    }
  }
  if (rootInfo == 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.