Examples of removeLastSegments()


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

    // the FILTERTYPE expression!
    String tempRulesFileName = getTempRulesFileName();
    IPath path = new Path(tempRulesFileName);
    ae.setConfigParameterValue(RutaEngine.PARAM_MAIN_SCRIPT, path.removeFileExtension()
            .lastSegment());
    String portableString = path.removeLastSegments(1).toPortableString();
    ae.setConfigParameterValue(RutaEngine.PARAM_SCRIPT_PATHS, new String[] { portableString });
    ae.setConfigParameterValue(RutaEngine.PARAM_ADDITIONAL_SCRIPTS, new String[0]);
    ae.setConfigParameterValue(RutaEngine.PARAM_RELOAD_SCRIPT, true);
    if (useDynamicAnchoring) {
      ae.setConfigParameterValue(RutaEngine.PARAM_DYNAMIC_ANCHORING, true);
View Full Code Here

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

  public static synchronized String getEngineDescriptorFromTMSourceFile(IPath scriptFilePath) {
    IPath folder = scriptFilePath;

    while (!folder.lastSegment().equals(RutaProjectUtils.getDefaultScriptLocation())) {
      folder = folder.removeLastSegments(1);
    }
    IPath relativeTo = scriptFilePath.makeRelativeTo(folder);
    IPath projectPath = folder.removeLastSegments(1);
    String elementName = scriptFilePath.lastSegment();
    int lastIndexOf = elementName.lastIndexOf(RutaEngine.SCRIPT_FILE_EXTENSION);
View Full Code Here

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

  public static synchronized String getTypeSystemDescriptorFromTMSourceFile(IPath scriptFilePath) {
    IPath folder = scriptFilePath;

    while (!folder.lastSegment().equals(RutaProjectUtils.getDefaultScriptLocation())) {
      folder = folder.removeLastSegments(1);
    }
    IPath relativeTo = scriptFilePath.makeRelativeTo(folder);
    IPath projectPath = folder.removeLastSegments(1);
    String elementName = scriptFilePath.lastSegment();
    int lastIndexOf = elementName.lastIndexOf(RutaEngine.SCRIPT_FILE_EXTENSION);
View Full Code Here

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

    // resolve to absolute url : this need not exact location of css file. It is important that absurl is not null.
    String ref = getElement().getAttribute(HTML40Namespace.ATTR_NAME_HREF);
    String absurl = (resolver != null && ref != null && ref.length() > 0) ? resolver.getLocationByURI(ref, true) : null;
    if ((absurl == null) || (absurl.length() == 0)) {
      IPath basePath = new Path(baseModel.getBaseLocation());
      URLHelper helper = new URLHelper(basePath.removeLastSegments(1).toString());
      absurl = helper.toAbsolute(ref == null ? "" : ref);//$NON-NLS-1$
    }
    if ((absurl == null) || (absurl.length() == 0)) {
      absurl = ref;
    }
View Full Code Here

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

          if (reference.startsWith(SLASH)) {
            referenceRuntimePath = new Path(reference);
          }
          else {
            IPath baseRuntimePath = virtualResources[i].getRuntimePath();
            referenceRuntimePath = baseRuntimePath.removeLastSegments(1).append(reference);
          }
         
          IVirtualFile virtualFile = ComponentCore.createFile(project, referenceRuntimePath);
          if (virtualFile != null && virtualFile.exists()) {
            IFile[] underlyingFiles = virtualFile.getUnderlyingFiles();
View Full Code Here

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

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

              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

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

      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

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

    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

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

        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
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.