Package org.eclipse.core.runtime

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


  public void testLibraryLocUnix() throws Exception { testLibraryLocUnix$(); }
  public void testLibraryLocUnix$() throws Exception {
    Path compilerPath = epath(CompilerInstallDetector_Test.MOCK_DMD2_SYSTEM_CMDPATH);
    LibraryLocation[] libLocations = getLibraryLocations(new DMDInstallType(), compilerPath);
   
    checkLibLocations(libLocations, compilerPath.removeLastSegments(3),
      "usr/include/dmd/druntime/import", "usr/include/dmd/phobos");    
  }
 
  @Test
  public void testLibraryLocUnix2() throws Exception { testLibraryLocUnix2$(); }
View Full Code Here


  public void testLibraryLocUnix2() throws Exception { testLibraryLocUnix2$(); }
  public void testLibraryLocUnix2$() throws Exception {
    Path compilerPath = epath(CompilerInstallDetector_Test.MOCK_DMD2_SYSTEM2_CMDPATH2);
    LibraryLocation[] libLocations = getLibraryLocations(new DMDInstallType(), compilerPath);
   
    checkLibLocations(libLocations, compilerPath.removeLastSegments(3),
      "include/d/dmd/druntime/import", "include/d/dmd/phobos")
  }
 
  public static LibraryLocation[] getLibraryLocations(CommonInstallType dmdInstallType, Path compilerPath) {
    IEnvironment env = LocalEnvironment.getInstance();
View Full Code Here

    File file = new File(firstPage.getLocationURI());
    IPath location = new Path(file.toString());
   
    // let the create-project command handle folder creation
    if (firstPage.isInLocalServer()) {
      location = location.removeLastSegments(1);
    }
   
    CreateProjectJob projectJob = new CreateProjectJob(location, firstPage.nameGroup.getName(), filterItem.getPackage().getName(), filterItem.getSelectedVersion());
    projectJob.setJobListener(new JobListener() {
      @Override
View Full Code Here

    final String fileContent = "<html><body>This is a test file</body></html>";
    WebResponse createdFile = createFileOnServer("", filename, fileContent);
    URL fileLocation = createdFile.getURL();
    IPath filepath = new Path(fileLocation.getPath());
    filepath = filepath.removeFirstSegments(new Path(FILE_SERVLET_LOCATION).segmentCount()); // chop off leading /file/
    filepath = filepath.removeLastSegments(1); // chop off trailing /foo.html
    filepath = filepath.makeAbsolute();
    filepath = filepath.addTrailingSeparator();
    String parentFolder = filepath.toString();

    // User B: Give access to test's workspace
View Full Code Here

      Path path = new Path(pattern.toRegex(new Date()));

      if (!path.isAbsolute())
        dir = new File("."); //$NON-NLS-1$
      else {
        dir = path.removeLastSegments(1).toFile();

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

    JSONArray diffs = new JSONArray();
    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$
View Full Code Here

  @Override
  public boolean handleRequest(HttpServletRequest request, HttpServletResponse response, String path) throws ServletException {
    Repository db = null;
    try {
      IPath p = new Path(path);
      IPath filePath = p.hasTrailingSeparator() ? p : p.removeLastSegments(1);
      if (!AuthorizationService.checkRights(request.getRemoteUser(), "/" + filePath.toString(), request.getMethod())) {
        response.sendError(HttpServletResponse.SC_FORBIDDEN);
        return true;
      }
      Set<Entry<IPath, File>> set = GitUtils.getGitDirs(filePath, Traverse.GO_UP).entrySet();
View Full Code Here

            && !f.getName().contains(".doc.source")) {
          String versionName = fPath
              .segment(fPath.segmentCount() - 3);
          String siteName = fPath.segment(fPath.segmentCount() - 4);

          displayNameFile = fPath.removeLastSegments(3).append(
              "displayname.txt").toFile();
          if (displayNameFile.exists()) {
            try {
              siteDisplayName = FileUtil.getContent(
                  displayNameFile, "UTF-8").toString().trim();
View Full Code Here

            if (element.equals(fProvider.getRoot())) {
                return null;
            }
            IPath path= new Path(fProvider.getFullPath(element));
            if (path.segmentCount() > 0) {
                return findElement(path.removeLastSegments(1));
            }
            return fProvider.getRoot();
        }
   
        /* non java-doc
View Full Code Here

  public ICompilationUnit createCompilationUnit(
      IPackageFragmentRoot fragmentRoot, String testsrc, String path)
      throws CoreException, IOException {
    IPath typepath = new Path(path);
    String pkgname = typepath.removeLastSegments(1).toString()
        .replace('/', '.');
    IPackageFragment fragment = createPackage(fragmentRoot, pkgname);
    StringBuffer sb = new StringBuffer();
    InputStream source = openTestResource(new Path(testsrc).append(typepath));
    Reader r = new InputStreamReader(source);
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.