Package org.eclipse.core.runtime

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


      IPath path = getStateLocation();
     
      if(path != null) {
        path = path.append("cached" + Path.SEPARATOR + CardNameUtil.getNameOnDisk(getName()) + ".jpg");
       
        if(path.toFile().exists()) {
          ImageDescriptor desc = null;
          try {
            desc = ImageDescriptor.createFromURL(new URL("file", "", path.toString()));
          } catch (MalformedURLException e) {
            e.printStackTrace();
View Full Code Here


          .computeDefaultRuntimeClassPath(javaProject);
      List<URL> urlList = new ArrayList<URL>();
      for (int i = 0; i < classPathEntries.length; i++) {
        String entry = classPathEntries[i];
        IPath path = new Path(entry);
        URL url = path.toFile().toURI().toURL();
        urlList.add(url);
      }
      ClassLoader parentClassLoader = project.getClass().getClassLoader();
      URL[] urls = (URL[]) urlList.toArray(new URL[urlList.size()]);
      URLClassLoader classLoader = new URLClassLoader(urls,
View Full Code Here

      setMessage("Please select a target path");
      return false;
    }
   
    IPath targetPath = new Path(target);
    File file = targetPath.toFile();
   
    if (file == null || ! file.exists()  || ! file.isDirectory()) {
      setErrorMessage("The selected target location is invalid");
      return false;
    }
View Full Code Here

  private void createServer() {
    try {
      String prop = PreferenceHelper.getString(ServerConstants.CONFIG_SEARCH_INDEX_LOCATION);
      if (prop != null) {
        IPath rootPath = new Path(prop);
        File rootFile = rootPath.toFile();
        baseDir = new File(rootFile, PI_SEARCH + "/v" + CURRENT_INDEX_GENERATION); //$NON-NLS-1$
      } else {
        IPath rootPath = OrionConfiguration.getPlatformLocation();
        File rootFile = rootPath.toFile();
        baseDir = new File(rootFile, ".metadata/.plugins/" + PI_SEARCH + "/v" + CURRENT_INDEX_GENERATION); //$NON-NLS-1$
View Full Code Here

        IPath rootPath = new Path(prop);
        File rootFile = rootPath.toFile();
        baseDir = new File(rootFile, PI_SEARCH + "/v" + CURRENT_INDEX_GENERATION); //$NON-NLS-1$
      } else {
        IPath rootPath = OrionConfiguration.getPlatformLocation();
        File rootFile = rootPath.toFile();
        baseDir = new File(rootFile, ".metadata/.plugins/" + PI_SEARCH + "/v" + CURRENT_INDEX_GENERATION); //$NON-NLS-1$
      }

      // discard all server data if the index generation has changed
      if (readIndexGeneration(baseDir) != CURRENT_INDEX_GENERATION) {
View Full Code Here

  public String getRealPath(String path) {
    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)
View Full Code Here

      return null;

    File f = null;
    IPath tmpPath = new Path(root.getAbsolutePath());
    tmpPath = tmpPath.append(path);
    f = tmpPath.toFile();
    if (f.exists())
      return f.toURI().toURL();
    else {
      // Search WebContext/WEB-INF/classes for resource.
      tmpPath = new Path(root.getAbsolutePath());
View Full Code Here

      return f.toURI().toURL();
    else {
      // Search WebContext/WEB-INF/classes for resource.
      tmpPath = new Path(root.getAbsolutePath());
      tmpPath = tmpPath.append("/WEB-INF/classes").append(path);
      f = tmpPath.toFile();
      if (f.exists())
        return f.toURI().toURL();
    }

    return null;
View Full Code Here

      return pathStrs;

    File root = getWebContentRoot();
    IPath p = new Path(root.getAbsolutePath());
    p = p.append(path);
    File f = p.toFile();
    if (f.exists() && f.isDirectory()) {
      File[] fileList = f.listFiles();
      for (int i = 0; i < fileList.length; i++) {
        String fileName = fileList[i].getName();
        // Make sure the path is start with a "/" and end with "/" if
View Full Code Here

    if (isLocalTarget) {
      IPath targetPath = new Path(context.getTargetUrl());
      monitor.beginTask("Move to local directory: "
          + targetPath.toPortableString(), 100);
      try {
        File target = targetPath.toFile();
        if (target != null) {
          if (!target.exists() || target.isFile()) {
            FileUtil.createFile(target, true);
          }
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.