Tabnine Logo
IPath.removeFileExtension
Code IndexAdd Tabnine to your IDE (free)

How to use
removeFileExtension
method
in
org.eclipse.core.runtime.IPath

Best Java code snippets using org.eclipse.core.runtime.IPath.removeFileExtension (Showing top 20 results out of 324)

origin: org.eclipse.core/runtime

public Properties getProductTranslation() {
  initValues();
  URL transURL = null;
  if (customizationValue != null)
    transURL = FileLocator.find(customizationBundle, NL_DIR.append(customizationValue).removeFileExtension().addFileExtension(PROPERTIES_FILE_EXTENSION), null);
  if (transURL == null && InternalPlatform.DEBUG_PLUGIN_PREFERENCES)
    InternalPlatform.message("No preference translations found for product/file: " + customizationBundle.getSymbolicName() + '/' + customizationValue); //$NON-NLS-1$
  return loadProperties(transURL);
}
origin: liferay/liferay-ide

public static String getLastSegment(IPath path, boolean removeFileExtension) {
  if (path == null) {
    return null;
  }
  if (removeFileExtension) {
    path.removeFileExtension();
  }
  return path.lastSegment();
}
origin: at.bestsolution.efxclipse.eclipse/org.eclipse.debug.core

/**
 * Given a name that ends with .launch, return the simple name of the configuration.
 *
 * @param fileName the name to parse
 * @return simple name
 * @since 3.5
 */
protected static String getSimpleName(String fileName) {
  IPath path = new Path(fileName);
  if(ILaunchConfiguration.LAUNCH_CONFIGURATION_FILE_EXTENSION.equals(path.getFileExtension())) {
    return path.removeFileExtension().toString();
  }
  return fileName;
}
origin: org.eclipse/org.eclipse.wst.xsd.ui

 private static String getFileName(XSDSchema schema)
 {
  URI schemaURI = schema.eResource().getURI();
  IPath filePath = new Path(schemaURI.toString());
  return filePath.removeFileExtension().lastSegment().toString();
 }  
}
origin: io.sarl/io.sarl.eclipse

@Override
public String getName() {
  String nam = getNameNoDefault();
  if (Strings.isNullOrEmpty(nam)) {
    final IPath path = getJarFile();
    if (path != null) {
      nam = path.removeFileExtension().lastSegment();
    } else {
      nam = getId();
    }
  }
  return nam;
}
origin: eclipse/aCute

static File getProgram(IContainer project) {
  IPath projectFile = ProjectFileAccessor.getProjectFile(project);
  String projectConfiguration = "Debug"; //$NON-NLS-1$
  String[] frameworks = ProjectFileAccessor.getTargetFrameworks(project.getWorkspace().getRoot().getFile(projectFile).getLocation());
  if (frameworks.length > 0) {
    return new File(project.getLocation().toFile().getAbsolutePath() + "/bin/" + projectConfiguration + "/" + frameworks[0] + "/" //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
        + projectFile.removeFileExtension().addFileExtension("dll").lastSegment()); //$NON-NLS-1$
  }
  return null;
}
origin: org.eclipse/org.eclipse.jst.pagedesigner

public Object[] getResult() {
  Object[] objects = super.getResult();
  if (objects == null || objects.length == 0) {
    return null;
  }
  IPath path = JavaUtil.getPathOnClasspath(_javaProject, objects[0]);
  String result = null;
  if (path.segmentCount() == 0) {
    return new Object[] { "" };
  }
  path = path.removeFileExtension();
  result = path.toOSString();
  result = result.replace(File.separatorChar, '.');
  return new Object[] { result };
}
origin: org.eclipse.scout.sdk.deps/org.eclipse.core.runtime

@Override
public Properties getProductTranslation() {
  initValues();
  URL transURL = null;
  if (customizationValue != null)
    transURL = FileLocator.find(customizationBundle, NL_DIR.append(customizationValue).removeFileExtension().addFileExtension(PROPERTIES_FILE_EXTENSION), null);
  if (transURL == null && InternalPlatform.DEBUG_PLUGIN_PREFERENCES)
    InternalPlatform.message("No preference translations found for product/file: " + customizationBundle.getSymbolicName() + '/' + customizationValue); //$NON-NLS-1$
  return loadProperties(transURL);
}
origin: org.jibx.config.3rdparty.org.eclipse/org.eclipse.core.runtime

public Properties getProductTranslation() {
  initValues();
  URL transURL = null;
  if (customizationValue != null)
    transURL = FileLocator.find(customizationBundle, NL_DIR.append(customizationValue).removeFileExtension().addFileExtension(PROPERTIES_FILE_EXTENSION), null);
  if (transURL == null && InternalPlatform.DEBUG_PLUGIN_PREFERENCES)
    InternalPlatform.message("No preference translations found for product/file: " + customizationBundle.getSymbolicName() + '/' + customizationValue); //$NON-NLS-1$
  return loadProperties(transURL);
}
origin: org.eclipse/core-runtime

public Properties getProductTranslation() {
  initValues();
  URL transURL = null;
  if (customizationValue != null)
    transURL = FileLocator.find(customizationBundle, NL_DIR.append(customizationValue).removeFileExtension().addFileExtension(PROPERTIES_FILE_EXTENSION), null);
  if (transURL == null && InternalPlatform.DEBUG_PLUGIN_PREFERENCES)
    InternalPlatform.message("No preference translations found for product/file: " + customizationBundle.getSymbolicName() + '/' + customizationValue); //$NON-NLS-1$
  return loadProperties(transURL);
}
origin: org.eclipse.jdt/org.eclipse.jdt.ui

public UnpackJarBuilder(JarPackageData jarPackage) {
  fSubfolder= jarPackage.getAbsoluteJarLocation().removeFileExtension().lastSegment() + SUBFOLDER_SUFFIX;
  fSubfolderPath= jarPackage.getAbsoluteJarLocation().removeLastSegments(1).append(fSubfolder);
  fJarPackage= jarPackage;
}
origin: org.eclipse.scout.sdk.deps/org.eclipse.jdt.ui

public UnpackJarBuilder(JarPackageData jarPackage) {
  fSubfolder= jarPackage.getAbsoluteJarLocation().removeFileExtension().lastSegment() + SUBFOLDER_SUFFIX;
  fSubfolderPath= jarPackage.getAbsoluteJarLocation().removeLastSegments(1).append(fSubfolder);
  fJarPackage= jarPackage;
}
origin: org.eclipse/org.eclipse.jdt.ui

/**
 *    Open an appropriate destination browser so that the user can specify a source
 *    to import from
 */
protected void handleDescriptionFileBrowseButtonPressed() {
  SaveAsDialog dialog= new SaveAsDialog(getContainer().getShell());
  dialog.create();
  dialog.getShell().setText(JarPackagerMessages.JarOptionsPage_saveAsDialog_title); 
  dialog.setMessage(JarPackagerMessages.JarOptionsPage_saveAsDialog_message); 
  dialog.setOriginalFile(createFileHandle(fJarPackage.getDescriptionLocation()));
  if (dialog.open() == Window.OK) {
    IPath path= dialog.getResult();
    path= path.removeFileExtension().addFileExtension(JarPackagerUtil.DESCRIPTION_EXTENSION);
    fDescriptionFileText.setText(path.toString());
  }
}
origin: org.eclipse/org.eclipse.ajdt.ui

/**
 *    Open an appropriate destination browser so that the user can specify a source
 *    to import from
 */
protected void handleDescriptionFileBrowseButtonPressed() {
  SaveAsDialog dialog= new SaveAsDialog(getContainer().getShell());
  dialog.create();
  dialog.getShell().setText(JarPackagerMessages.JarOptionsPage_saveAsDialog_title); 
  dialog.setMessage(JarPackagerMessages.JarOptionsPage_saveAsDialog_message); 
  dialog.setOriginalFile(createFileHandle(fJarPackage.getDescriptionLocation()));
  if (dialog.open() == Window.OK) {
    IPath path= dialog.getResult();
    path= path.removeFileExtension().addFileExtension(AJJarPackagerUtil.DESCRIPTION_EXTENSION);
    fDescriptionFileText.setText(path.toString());
  }
}
origin: org.eclipse.scout.sdk.deps/org.eclipse.jdt.ui

@Override
protected IPath createNewPath() {
  final IPath path= getResourcePath();
  if (path.getFileExtension() != null)
    return path.removeFileExtension().removeLastSegments(1).append(getNewName());
  else
    return path.removeLastSegments(1).append(getNewName());
}
origin: eclipse/eclipse.jdt.ls

@Override
protected IPath createNewPath() {
  final IPath path= getResourcePath();
  if (path.getFileExtension() != null) {
    return path.removeFileExtension().removeLastSegments(1).append(getNewName());
  } else {
    return path.removeLastSegments(1).append(getNewName());
  }
}
origin: org.eclipse/org.eclipse.jdt.ui

protected IPath createNewPath() {
  final IPath path= getResourcePath();
  if (path.getFileExtension() != null)
    return path.removeFileExtension().removeLastSegments(1).append(getNewName());
  else
    return path.removeLastSegments(1).append(getNewName());
}
origin: org.eclipse.jdt/org.eclipse.jdt.ui

@Override
protected IPath createNewPath() {
  final IPath path= getResourcePath();
  if (path.getFileExtension() != null)
    return path.removeFileExtension().removeLastSegments(1).append(getNewName());
  else
    return path.removeLastSegments(1).append(getNewName());
}
origin: org.eclipse.pde.api.tools/ui

public String getLabel() {
  if(plural) {
    return MarkerMessages.FilterProblemResolution_create_filters_for_problems;
  }
  else {
    IJavaElement element = resolveElementFromMarker();
    if(element != null) {
      return MessageFormat.format(MarkerMessages.FilterProblemResolution_0, new String[] {JavaElementLabels.getTextLabel(element, JavaElementLabels.M_PARAMETER_TYPES), resolveCategoryName()});
    }
    else {
      IResource res = fBackingMarker.getResource();
      return MessageFormat.format(MarkerMessages.FilterProblemResolution_0, new String[] {res.getFullPath().removeFileExtension().lastSegment(), resolveCategoryName()});
    }
  }
}

origin: org.eclipse.pde.api.tools/ui

public String getLabel() {
  if(plural) {
    return MarkerMessages.FilterProblemWithCommentResolution_create_commented_filters;
  }
  else {
    IJavaElement element = resolveElementFromMarker();
    if(element != null) {
      return MessageFormat.format(MarkerMessages.FilterProblemWithCommentResolution_create_commented_filter, new String[] {JavaElementLabels.getTextLabel(element, JavaElementLabels.M_PARAMETER_TYPES), resolveCategoryName()});
    }
    else {
      IResource res = fBackingMarker.getResource();
      return MessageFormat.format(MarkerMessages.FilterProblemWithCommentResolution_create_commented_filter, new String[] {res.getFullPath().removeFileExtension().lastSegment(), resolveCategoryName()});
    }
  }
}

org.eclipse.core.runtimeIPathremoveFileExtension

Javadoc

Returns a new path which is the same as this path but with the file extension removed. If this path does not have an extension, this path is returned.

The file extension portion is defined as the string following the last period (".") character in the last segment. If there is no period in the last segment, the path has no file extension portion. If the last segment ends in a period, the file extension portion is the empty string.

Popular methods of IPath

  • toString
    Returns a string representation of this path, including its device id. The same separator, "/", is u
  • toFile
    Returns a java.io.File corresponding to this path.
  • toOSString
    Returns a string representation of this path which uses the platform-dependent path separator define
  • append
    Returns the canonicalized path obtained from the concatenation of the given path's segments to the e
  • segmentCount
    Returns the number of segments in this path. Note that both root and empty paths have 0 segments.
  • removeLastSegments
    Returns a copy of this path with the given number of segments removed from the end. The device id is
  • lastSegment
    Returns the last segment of this path, ornull if it does not have any segments.
  • removeFirstSegments
    Returns a copy of this path with the given number of segments removed from the beginning. The device
  • segment
    Returns the specified segment of this path, ornull if the path does not have such a segment.
  • equals
    Returns whether this path equals the given object. Equality for paths is defined to be: same sequenc
  • isAbsolute
    Returns whether this path is an absolute path (ignoring any device id). Absolute paths start with a
  • isPrefixOf
    Returns whether this path is a prefix of the given path. To be a prefix, this path's segments must a
  • isAbsolute,
  • isPrefixOf,
  • toPortableString,
  • makeRelative,
  • makeAbsolute,
  • getDevice,
  • isEmpty,
  • addTrailingSeparator,
  • getFileExtension,
  • setDevice

Popular in Java

  • Running tasks concurrently on multiple threads
  • getResourceAsStream (ClassLoader)
  • scheduleAtFixedRate (ScheduledExecutorService)
  • startActivity (Activity)
  • Charset (java.nio.charset)
    A charset is a named mapping between Unicode characters and byte sequences. Every Charset can decode
  • MessageDigest (java.security)
    Uses a one-way hash function to turn an arbitrary number of bytes into a fixed-length byte sequence.
  • Deque (java.util)
    A linear collection that supports element insertion and removal at both ends. The name deque is shor
  • StringTokenizer (java.util)
    Breaks a string into tokens; new code should probably use String#split.> // Legacy code: StringTo
  • JComboBox (javax.swing)
  • Runner (org.openjdk.jmh.runner)
  • From CI to AI: The AI layer in your organization
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now