Package org.eclipse.core.runtime

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


        f = getBasePackage(testFolderFile);
        if (f != null && testRoot != null) {
          IPath p = new Path(f.getPath());
          p = p.makeRelativeTo(project.getProject().getParent().getRawLocation().append(getPackageFragmentRoot().getPath().makeRelative()));
          String name = "";
          StringTokenizer strTok = new StringTokenizer(p.toOSString(), File.separator);
          while (strTok.hasMoreTokens()) {
            String tok = strTok.nextToken();
            if (name.trim().length()>0) {
              name += ".";
            }
View Full Code Here


            String contents = getResourceContents(nodes[i]);
            IPath path = new Path(Activator.getDefault().getStateLocation().toOSString() +
                                  File.separator + "t" + //$NON-NLS-1$
                                  String.valueOf(System.currentTimeMillis()));
            if (!path.toFile().mkdir()) {
                throw new Exception("Could not create directory " + path.toOSString()); //$NON-NLS-1$
            }
            path.toFile().deleteOnExit();
            File transfer = new File(path + File.separator + nodes[i].getName());
            transfer.deleteOnExit();
            FileOutputStream fos = new FileOutputStream(transfer);
View Full Code Here

            writer.flush();
            writer.close();
            res.add(transfer.getAbsolutePath());

            IPath metaPath = GuvnorMetadataUtils.
                                createGuvnorMetadataLocation(path.toOSString());
            metaPath.toFile().deleteOnExit();
            File metaFile = GuvnorMetadataUtils.
                                getGuvnorMetadataFile(metaPath.toOSString(), nodes[i].getName());
            metaFile.deleteOnExit();
            GuvnorMetadataUtils.writeGuvnorMetadataProps(metaFile, getGuvnorMetadataProps(nodes[i]));
View Full Code Here

    public static IPath createGuvnorMetadataLocation(String rootPath) throws Exception {
        IPath path = new Path(rootPath + File.separator + ".guvnorinfo"); //$NON-NLS-1$
        if (!path.toFile().exists()) {
            if (!path.toFile().mkdir()) {
                throw new Exception("Could not create directory " + path.toOSString()); //$NON-NLS-1$
            }
        }
        return path;
    }
View Full Code Here

      IPath location = new Path(folder);

      // location must not overlap the workspace (unless it's a nested project)
      IPath workspaceLocation = workspace.getRoot().getRawLocation();
      IPath relLocation = null;
      if (location.toOSString().toLowerCase().startsWith(
            workspaceLocation.toOSString().toLowerCase()))
      {
        relLocation = location.removeFirstSegments(
            location.matchingFirstSegments(workspaceLocation));
      }
View Full Code Here

      IPath workspaceLocation = workspace.getRoot().getRawLocation();
      IPath location = new Path(newDir);
      // if the new location overlaps the workspace, then set location to null
      // to force eclipse to move the project to the default location in the
      // workspace. Also, take the last segment as the new project name.
      if (location.toOSString().toLowerCase().startsWith(
            workspaceLocation.toOSString().toLowerCase()))
      {
        String name = location.removeFirstSegments(
            location.matchingFirstSegments(workspaceLocation)).toString();
        // hack for windows... manually remove drive letter
View Full Code Here

        .click();
    shell = bot.shell(UIText.NewRepositoryWizard_WizardTitle);
    newPath = new Path(getTestDirectory().getPath()).append("bare").append(
        "NewBareRepository");
    shell.bot().textWithLabel(UIText.CreateRepositoryPage_DirectoryLabel)
        .setText(newPath.toOSString());
    shell.bot().checkBox(UIText.CreateRepositoryPage_BareCheckbox).select();
    shell.bot().button(IDialogConstants.FINISH_LABEL).click();
    refreshAndWait();
    repoFile = newPath.toFile();
    myRepoViewUtil.getRootItem(getOrOpenView().bot().tree(), repoFile);
View Full Code Here

          path = Path.fromPortableString("."); //$NON-NLS-1$
        else
          path = withoutLastSegment;
        treeItem.setText(0, path.toString());
      }
      treeItem.setText(2, relativePath.toOSString());
      try {
        IProject project = m.getContainer().getProject();
        Repository repo = new RepositoryBuilder().setGitDir(
            m.getGitDirAbsolutePath().toFile()).build();
        File workTree = repo.getWorkTree();
View Full Code Here

   * @return the directory where to create the Repository (with operating
   *         system specific path separators)
   */
  public String getDirectory() {
    IPath path = new Path(directoryText.getText().trim());
    return path.toOSString();
  }

  /**
   * @return <code>true</code> if a bare Repository is to be created
   */
 
View Full Code Here

      IPath repoPath = new Path(repository.getWorkTree()
          .getAbsolutePath());
      if (!repoPath.isPrefixOf(gitIgnorePath)) {
        String message = NLS.bind(
            CoreText.IgnoreOperation_parentOutsideRepo,
            path.toOSString(), repoPath.toOSString());
        IStatus status = Activator.error(message, null);
        throw new CoreException(status);
      }
      File gitIgnore = new File(gitIgnorePath.toOSString());
      updateGitIgnore(gitIgnore, entry);
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.