Package org.eclipse.core.runtime

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


        // a resource outside the workspace as well, in particular
        // point to dependency jars outside of the
        // workspace. All these cases must be handled.
        IResource workspaceResource = null;
        IPath resourcePath = new Path(localResourceLocation);
        File publishableFile = resourcePath.toFile();

        // First see if it is a full path to an existing file.
        if (projectPath != null && publishableFile != null
            && publishableFile.exists()) {
View Full Code Here


       
        IPath path = new Path(filePath);
        path = path.append(".metadata");
        path = path.append(".log");
       
        final File file = path.toFile();
       
        fileWatcher = new FileWatcher(file);
       
        asyncExec(new Runnable() {
            public void run()
View Full Code Here

        for (int i = 0; i < nodes.length; i++) {
            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();
View Full Code Here

                                  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);
            PrintWriter writer = new PrintWriter(fos);
            writer.write(contents);
View Full Code Here

    } catch (Exception e) {
      e.printStackTrace();
      throw new RuntimeException(e);
    }

    return path.toFile();
  }

  public String getName() {
    return resource.getProject().getName() + "/" + resource.getName();
  }
View Full Code Here

        if (url == null) {
            Path path = javadocArtifact;
            if (path != null) {
                String u;
                try {
                    u = "jar:" + path.toFile().toURI().toURL().toExternalForm() + "!/";
                    try {
                        url = new URL(u);
                    } catch (MalformedURLException e) {
                        // this should not happen
                        IvyPlugin.log(IStatus.ERROR,
View Full Code Here

        if (url == null) {
            Path path = javadocArtifact;
            if (path != null) {
                String u;
                try {
                    u = "jar:" + path.toFile().toURI().toURL().toExternalForm() + "!/";
                    try {
                        url = new URL(u);
                    } catch (MalformedURLException e) {
                        // this should not happen
                        IvyPlugin.log(IStatus.ERROR,
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

        return null;
      }

      // there is no project. we can't expect IProject help to create
      // id/inputStream
      java.io.File file = fullIPath.toFile();

      // obatin id
      id = calculateId(fullIPath);

      // obtain InputStream
View Full Code Here

          String baseLocation = model.getBaseLocation();
          // The baseLocation may be a path on disk or relative to the
          // workspace root. Don't translate on-disk paths to
          // in-workspace resources.
          IPath basePath = new Path(baseLocation);
          if (basePath.segmentCount() > 1 && !basePath.toFile().exists()) {
            file = ResourcesPlugin.getWorkspace().getRoot().getFile(basePath);
          }
        }
      }
      finally {
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.