Package org.eclipse.core.runtime

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


        if (!useBndWorkspace) {
            IPath loc = getExternalLocation();
            if (loc == null || loc.isEmpty())
                return new Status(IStatus.ERROR, Plugin.PLUGIN_ID, 0, "Project location invalid or not specified.", null);

            if (!loc.lastSegment().equals(projectName))
                return new Status(IStatus.ERROR, Plugin.PLUGIN_ID, 0, "Project location must end with specified project name", null);
        }

        // Check valid name
        IStatus nameStatus = JavaPlugin.getWorkspace().validateName(projectName != null ? projectName : "", IResource.PROJECT);
View Full Code Here


                projectLocation = new Path(path);
            } catch (IOException e) {
                // TODO Auto-generated catch block
                e.printStackTrace();
            }
            String existingName = projectLocation.lastSegment();
            if (!existingName.equals(projectName))
                return new Status(IStatus.ERROR, Plugin.PLUGIN_ID, 0, MessageFormat.format("The name of the new project must be ''{0}''", existingName), null);
        }

        return Status.OK_STATUS;
View Full Code Here

            public void propertyChange(PropertyChangeEvent evt) {
                Collection<IPath> paths = classPathPage.getPaths();
                packageListPage.setJarPaths(paths);

                IPath firstPath = paths != null && !paths.isEmpty() ? paths.iterator().next() : null;
                String name = firstPath != null ? firstPath.lastSegment() : "";
                if (name.toLowerCase().endsWith(".jar"))
                    name = name.substring(0, name.length() - 4);

                packageListPage.setProjectName(name);
            }
View Full Code Here

                    projectLocation = new Path(canonicalPath);
                } catch (IOException e) {
                    JavaPlugin.log(e);
                }

                String existingName = projectLocation.lastSegment();
                String newName = null; // fNameGroup.getName();
                if (!existingName.equals(newName)) {
                    setErrorMessage(Messages.format("The name of the new project must be ''{0}''", BasicElementLabels.getResourceName(existingName)));
                    setPageComplete(false);
                    return;
View Full Code Here

              // directory
              if (childUri == null) {
                childUri = "WEB-INF/lib/" + child.getName(); //$NON-NLS-1$
              }
              IPath jarPath = new Path(childUri);
              File jarFile = new File(tempFile, jarPath.lastSegment());
              jarPath = jarPath.removeLastSegments(1);

              IModuleResource[] mr = server.getResources(new IModule[] { child });
              IStatus[] status = helper.publishToPath(mr, new Path(jarFile.getAbsolutePath()), monitor);
              merge(result, status);
View Full Code Here

              // other modules are assembled into a jar
              if (childUri == null) {
                childUri = "WEB-INF/lib/" + child.getName() + ".jar"; //$NON-NLS-1$ //$NON-NLS-2$
              }
              IPath jarPath = new Path(childUri);
              File jarFile = new File(tempFile, jarPath.lastSegment());
              jarPath = jarPath.removeLastSegments(1);

              IModuleResource[] mr = server.getResources(new IModule[] { child });
              IStatus[] status = helper.publishZip(mr, new Path(jarFile.getAbsolutePath()), monitor);
              merge(result, status);
View Full Code Here

  }

  private static boolean isBootJar(IClasspathEntry e) {
    if (e.getEntryKind() == IClasspathEntry.CPE_LIBRARY) {
      IPath path = e.getPath();
      String name = path.lastSegment();
      return name.endsWith(".jar") && name.startsWith("spring-boot"); //$NON-NLS-1$ //$NON-NLS-2$
    }
    return false;
  }
}
View Full Code Here

  public Collection findFiles(IStorage f1, String pathStr, boolean ignoreCase) {
    IOFileFilter filter;
    IPath path = new Path(pathStr);
    if (path.segment(0).equals("*")) {
      IOCase ioCase = ignoreCase ? IOCase.INSENSITIVE    : IOCase.SENSITIVE;
      filter = new NameFileFilter(path.lastSegment(), ioCase);
    } else {
      String lastSegment = path.lastSegment();
      if (lastSegment.startsWith("*")) {
        filter = new SuffixFileFilter(lastSegment.substring(1));
      } else {
View Full Code Here

    IPath path = new Path(pathStr);
    if (path.segment(0).equals("*")) {
      IOCase ioCase = ignoreCase ? IOCase.INSENSITIVE    : IOCase.SENSITIVE;
      filter = new NameFileFilter(path.lastSegment(), ioCase);
    } else {
      String lastSegment = path.lastSegment();
      if (lastSegment.startsWith("*")) {
        filter = new SuffixFileFilter(lastSegment.substring(1));
      } else {
        filter = null;
      }
View Full Code Here

      if(useSource)
        p1 = new Path(this.sourcePath).append(path);
      else
        p1 = new Path(this.basePath).append(path);
     
      String name = p1.lastSegment();
      IPath newBase = p1.removeLastSegments(1);

      Enumeration e = this.bundleBase.findEntries(newBase.toString(),
          name, recurse);
      Vector found = new Vector();
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.