Examples of lastSegment()


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

                    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

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

                }

                String selected = dialog.open();
                if (selected != null) {
                    IPath path = new Path(selected);
                    if (projectName != null && !projectName.equals(path.lastSegment()))
                        selected = path.append(projectName).toString();
                    txtLocation.setText(selected);
                }
            }
        });
View Full Code Here

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

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

                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

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

            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

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

                    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

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

              // 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

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

              // 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

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

  }

  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

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

  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
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.