Package org.eclipse.core.runtime

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


  @Override
  protected void beginValidation() throws ValidationException {
   
    IPath fileLocation = firstPage.PHPLocationGroup.getLocation();
    if (fileLocation.toPortableString().length() > 0) {
      final IFileHandle directory = environment.getFile(fileLocation);
      IPath futurepath = directory.getPath().append(firstPage.nameGroup.getName());
      File futureFile = futurepath.toFile();
      if ((futureFile.exists() && futureFile.isFile()) || (futureFile.exists() && futureFile.isDirectory() && futureFile.list().length > 0)) {
        throw new ValidationException("The target directory is not empty. Unable to run \"create-project\" with a target directory containing files.", Severity.ERROR);
View Full Code Here


              .append(fGroupName.getName()));
          fDetect = directory.isDirectory();
        }
      } else {
        IEnvironment environment = fPHPLocationGroup.getEnvironment();
        if (location.toPortableString().length() > 0) {
          final IFileHandle directory = environment.getFile(location);
          fDetect = directory.isDirectory()
              && directory.getPath().toFile().exists();
        }
      }
View Full Code Here

    gitSection.put(GitConstants.KEY_CLONE, cloneLocation);

    // add Git Tree URI
    IPath clonePath = new Path(cloneLocation.getPath()).removeFirstSegments(2);
    path = new Path(GitServlet.GIT_URI + '/' + Tree.RESOURCE).append(clonePath).append(Constants.HEAD)
        .append(targetPath.toPortableString().substring(clonePath.toPortableString().length()));
    link = new URI(location.getScheme(), location.getAuthority(), path.toString(), null, null);
    gitSection.put(GitConstants.KEY_TREE, link);

    representation.put(GitConstants.KEY_GIT, gitSection);
  }
View Full Code Here

    URI diffLocation = getURI(request);
    if (pattern != null) {
      IPath patternPath = new Path(pattern);
      IPath diffPath = new Path(diffLocation.getPath());
      diffPath = diffPath.removeLastSegments(patternPath.segmentCount());
      diffLocation = new URI(diffLocation.getScheme(), diffLocation.getAuthority(), diffPath.toPortableString(), null, null);
    }
    URI cloneLocation = BaseToCloneConverter.getCloneLocation(diffLocation, BaseToCloneConverter.DIFF);

    int page = request.getParameter("page") != null ? new Integer(request.getParameter("page")).intValue() : 0; //$NON-NLS-1$ //$NON-NLS-2$
    int pageSize = request.getParameter("pageSize") != null ? new Integer(request.getParameter("pageSize")).intValue() : Integer.MAX_VALUE; //$NON-NLS-1$ //$NON-NLS-2$
View Full Code Here

        return true;
      }

      gitSegment = GitUtils.decode(filterPath.segment(0));
      filterPath = filterPath.removeFirstSegments(1);
      pattern = filterPath.toPortableString();
      ObjectId head = repo.resolve(gitSegment);
      if (head == null) {
        throw new Exception("Missing ref in git segment");
      }
      walk = new RevWalk(repo);
View Full Code Here

      Path basePath = new Path(baseLocation.getPath());
      IPath tmp = new Path("/"); //$NON-NLS-1$
      for (int i = 0; i < 5; i++) {
        tmp = tmp.append(basePath.segment(i));
      }
      URI cloneLocation = new URI(baseLocation.getScheme(), baseLocation.getAuthority(), tmp.toPortableString(), null, baseLocation.getFragment());
      JSONObject ref = listEntry(gitSegment, 0, true, 0, cloneLocation, GitUtils.encode(gitSegment));

      parents.add(ref);
      parents.add(listEntry(new Path(cloneLocation.getPath()).lastSegment(), 0, true, 0, cloneLocation, null));
      URI locationWalk = URIUtil.append(cloneLocation, GitUtils.encode(gitSegment));
View Full Code Here

              FileUtil.deleteAllFile(webContentRoot, null);
          }

          if (!webContentRoot.exists()) {
            webContentRoot.mkdirs();
            FileUtil.unZipFile(bundleFile, webContentPath
                .toPortableString(), webContentRoot);
            // Record the last-modified timestamp in .metadata file.
            FileOutputStream out = new FileOutputStream(
                metadataFile);
            try {
View Full Code Here

  public static URL findWebContentURL(Bundle webundle, boolean ensureLocal)
      throws IOException {
    IPath webContentPath = findWebContentPath(webundle);
    if (webContentPath != null) {
      if (!ensureLocal)
        return webundle.getEntry(webContentPath.toPortableString());

      URL[] es = FileLocator.findEntries(webundle, webContentPath);
      if (es.length > 0) {
        // Extract the zipped entry to local file system.
        return FileLocator.toFileURL(es[0]);
View Full Code Here

    File root = getWebContentRoot();
    if (root != null && root.exists()) {
      IPath tmpPath = new Path(root.getAbsolutePath());
      tmpPath = tmpPath.append(path);
      if (tmpPath.toFile().exists())
        return tmpPath.toPortableString();

      // if not any file exists, just append the path to the root path and
      // return it.
      return new Path(root.getAbsolutePath()).append(path)
          .toPortableString();
View Full Code Here

        // Make sure the path is start with a "/" and end with "/" if
        // this path is a
        // directory.
        IPath currentPath = FileUtil.makeRelativeTo(p.append(fileName),
            webContentRootPath).makeAbsolute();
        String resPathStr = currentPath.toPortableString();
        if (fileList[i].isDirectory() && !resPathStr.endsWith("/"))
          resPathStr = resPathStr + "/";

        pathStrs.add(resPathStr);
      }
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.