Package org.eclipse.core.runtime

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


            // Add the jars from runtime/lib
            File libDirectory = runtimePath.append("lib").toFile();
            if (libDirectory != null && libDirectory.exists()) {
                for (File file : libDirectory.listFiles()) {
                    IPath path = new Path(file.getPath());
                    String name = path.lastSegment();
                    String extension = path.getFileExtension();
                   
                    // Only include jaxb, jaxws and jsr API JARs
                    if (!"jar".equals(extension)) {
                        continue;
View Full Code Here


            // Add the jars from runtime/modules
            File modulesDirectory = runtimePath.append("modules").toFile();
            if (modulesDirectory != null && modulesDirectory.exists()) {
                for (File file : modulesDirectory.listFiles()) {
                    IPath path = new Path(file.getPath());
                    String name = path.lastSegment();
                    String extension = path.getFileExtension();
                   
                    // Only include API and launcher JARs
                    if (!"jar".equals(extension)) {
                        continue;
View Full Code Here

          project.open(null);
        IPath location = new Path(project.getLocation()
            .toPortableString() + "/" + localFileName);
        LogService.info("retrieving resource [" + httpAddress
            + "] to project [" + location.toPortableString() + "]");
        IFile iFile = project.getFile(location.lastSegment());
        URL url = new URL(httpAddress);
        HttpURLConnection connection = (HttpURLConnection) url
            .openConnection();
        connection.setRequestMethod("GET");
        // give it 15 seconds to respond
View Full Code Here

          project.open(null);
        IPath location = new Path(project.getLocation()
            .toPortableString() + "/" + localFileName);
        LogService.ok("retrieving resource " + jioLocation
            + " to project " + location.toPortableString());
        IFile iFile = project.getFile(location.lastSegment());
        File sourceFile = new File(jioLocation);
        InputStream is = new FileInputStream(sourceFile);

        bis = new BufferedInputStream(is);
        if (!iFile.exists()) {
View Full Code Here

      else {
        dir = path.removeLastSegments(1).toFile();

        /* extract relative pattern */
        Path p = new Path(fileNamePattern);
        pattern = new FileNamePattern(p.lastSegment(), context);
      }

      final String patternRegex = pattern.toRegex();
      File[] files = dir.listFiles(new FilenameFilter() {
        @Override
View Full Code Here

    } else {
      // Else, generate it.
      Path bundleIdPath = new Path(bundleID.replace('.', '/'));
      if (bundleIdPath.segmentCount() == 1)
        return bundleID;
      String defaultNSPrefix = bundleIdPath.lastSegment().equals("web") ? bundleIdPath
          .segment(bundleIdPath.segmentCount() - 2)
          : bundleIdPath.lastSegment();
      return defaultNSPrefix;
    }
  }
View Full Code Here

      Path bundleIdPath = new Path(bundleID.replace('.', '/'));
      if (bundleIdPath.segmentCount() == 1)
        return bundleID;
      String defaultNSPrefix = bundleIdPath.lastSegment().equals("web") ? bundleIdPath
          .segment(bundleIdPath.segmentCount() - 2)
          : bundleIdPath.lastSegment();
      return defaultNSPrefix;
    }
  }

  public BundleContext getBundleContext() {
View Full Code Here

        if (srcPath != null && !srcPath.equals(relPath))
          relPath = makeRelativeTo(relPath, srcPath);
        // If the src file path is a file, use the file's name as
        // relative path.
        if (srcPath != null && srcPath.equals(relPath))
          relPath = new Path(relPath.lastSegment());

        File newFile = new File(new Path(targetFile.getAbsolutePath())
            .append(relPath).toPortableString());
        FileUtil.createFile(newFile, false);
        fos = new FileOutputStream(newFile);
View Full Code Here

  public void save() throws Exception {
    String fileName = null;
    if (source != null) {
      try {
        IPath path = new Path(source);
        fileName = path.lastSegment();
      } catch (Exception e) {
        // e.printStackTrace();
      }
    }
    source = LicenseManager.getInstance().saveLicense(
View Full Code Here

                }
                in.close();
                if (!resp.isCommitted())
                  resp.setContentType(req.getSession()
                      .getServletContext().getMimeType(
                          reqPath.lastSegment()));
                return;
              }
            } finally {
              // Release the lock of the jar file.
              jar.close();
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.