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

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

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

origin: org.eclipse/org.eclipse.jdt.debug.ui

public static boolean isArchivePath(IPath path) {
  String ext= path.getFileExtension();
  if (ext != null && ext.length() != 0) {
    for (int i= 0; i < fgArchiveExtensions.length; i++) {
      if (ext.equalsIgnoreCase(fgArchiveExtensions[i])) {
        return true;
      }
    }
  }
  return false;
}        

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

private int getImageType(final IPath path) {
  String extension = path.getFileExtension();
  if ("gif".equalsIgnoreCase(extension)) //$NON-NLS-1$
    return SWT.IMAGE_GIF;
  else if ("bmp".equalsIgnoreCase(extension)) //$NON-NLS-1$
    return SWT.IMAGE_BMP;
  else if ("png".equalsIgnoreCase(extension)) //$NON-NLS-1$
    return SWT.IMAGE_PNG;
  else if ("ico".equalsIgnoreCase(extension)) //$NON-NLS-1$
    return SWT.IMAGE_ICO;
  return SWT.IMAGE_PNG;
}
origin: org.eclipse.jdt/org.eclipse.jdt.core

public static boolean isJmod(File file) {
  IPath path = Path.fromOSString(file.getPath());
  if (path.getFileExtension().equalsIgnoreCase(SuffixConstants.EXTENSION_jmod)) {
    return true;
  }
  return false;
}

origin: org.eclipse/org.eclipse.jdt.ui

public static boolean isArchivePath(IPath path) {
  String ext= path.getFileExtension();
  if (ext != null && ext.length() != 0) {
    return isArchiveFileExtension(ext);
  }
  return false;
}

origin: org.eclipse.jdt/org.eclipse.jdt.ui

public static boolean isArchivePath(IPath path, boolean allowAllAchives) {
  if (allowAllAchives)
    return true;
  String ext= path.getFileExtension();
  if (ext != null && ext.length() != 0) {
    return isArchiveFileExtension(ext);
  }
  return false;
}
origin: org.eclipse.scout.sdk.deps/org.eclipse.jdt.ui

public static boolean isArchivePath(IPath path, boolean allowAllAchives) {
  if (allowAllAchives)
    return true;
  String ext= path.getFileExtension();
  if (ext != null && ext.length() != 0) {
    return isArchiveFileExtension(ext);
  }
  return false;
}
origin: org.eclipse.tycho/org.eclipse.jdt.core

public static boolean isJmod(File file) {
  IPath path = Path.fromOSString(file.getPath());
  if (path.getFileExtension().equalsIgnoreCase(SuffixConstants.EXTENSION_jmod)) {
    return true;
  }
  return false;
}

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

public boolean isFileValid(IPath path) {
  String ext = path.getFileExtension();
  if (isPathValid(path) && ext != null && ext.length() != 0)
    return ext.equals(jarExt);
  return false;
}
origin: org.eclipse.xtext/ui

  public boolean isLanguageResource(IResource resource) {
    String fileExtension = resource.getFullPath().getFileExtension();
    for (String ext : getFileExtensions()) {
      if (ext.equals(fileExtension))
        return true;
    }
    return false;
  }
}
origin: ajermakovics/eclipse-instasearch

/**
 * @param jarRes
 * @return
 */
private boolean isIndexable(IJarEntryResource jarRes) {
  String ext = jarRes.getFullPath().getFileExtension();
  
  return isIndexableExtension(ext);
}
origin: org.eclipse.pde/org.eclipse.pde.ui

@Override
public ImageDescriptor getImageDescriptor() {
  IEditorRegistry registry = PlatformUI.getWorkbench().getEditorRegistry();
  return registry.getImageDescriptor(fJarEntryFile.getFullPath().getFileExtension());
}
origin: org.eclipse.jdt/org.eclipse.jdt.ui

protected void updateModel() {
  // destination
  String comboText= fDestinationNamesCombo.getText();
  IPath path= Path.fromOSString(comboText);
  if (path.segmentCount() > 0 && ensureTargetFileIsValid(path.toFile()) && path.getFileExtension() == null)
    // append .jar
    path= path.addFileExtension(JarPackagerUtil.JAR_EXTENSION);
  fJarPackage.setJarLocation(path);
}
origin: org.eclipse.jdt/org.eclipse.jdt.ui

/**
 * Stores the widget values in the JAR package.
 */
@Override
protected void updateModel() {
  super.updateModel();
  String comboText= fAntScriptNamesCombo.getText();
  IPath path= Path.fromOSString(comboText);
  if (path.segmentCount() > 0 && ensureAntScriptFileIsValid(path.toFile()) && path.getFileExtension() == null)
    path= path.addFileExtension(ANTSCRIPT_EXTENSION);
  fAntScriptLocation= getAbsoluteLocation(path);
}
origin: io.sarl/io.sarl.eclipse

/**
 * Stores the widget values in the JAR package.
 */
@Override
protected void updateModel() {
  super.updateModel();
  String comboText= fAntScriptNamesCombo.getText();
  IPath path= Path.fromOSString(comboText);
  if (path.segmentCount() > 0 && ensureAntScriptFileIsValid(path.toFile()) && path.getFileExtension() == null)
    path= path.addFileExtension(ANTSCRIPT_EXTENSION);
  fAntScriptLocation= getAbsoluteLocation(path);
}
origin: org.eclipse.scout.sdk.deps/org.eclipse.jdt.ui

/**
 * Stores the widget values in the JAR package.
 */
@Override
protected void updateModel() {
  super.updateModel();
  String comboText= fAntScriptNamesCombo.getText();
  IPath path= Path.fromOSString(comboText);
  if (path.segmentCount() > 0 && ensureAntScriptFileIsValid(path.toFile()) && path.getFileExtension() == null)
    path= path.addFileExtension(ANTSCRIPT_EXTENSION);
  fAntScriptLocation= getAbsoluteLocation(path);
}
origin: org.eclipse.platform/org.eclipse.compare

@Override
public String getType() {
  return fHunkResult.getDiffResult().getDiff().getTargetPath(fHunkResult.getDiffResult().getConfiguration()).getFileExtension();
}
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.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/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());
}
org.eclipse.core.runtimeIPathgetFileExtension

Javadoc

Returns the file extension portion of this path, or null if there is none.

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,
  • setDevice

Popular in Java

  • Making http requests using okhttp
  • runOnUiThread (Activity)
  • setContentView (Activity)
  • notifyDataSetChanged (ArrayAdapter)
  • IOException (java.io)
    Signals a general, I/O-related error. Error details may be specified when calling the constructor, a
  • RandomAccessFile (java.io)
    Allows reading from and writing to a file in a random-access manner. This is different from the uni-
  • Properties (java.util)
    A Properties object is a Hashtable where the keys and values must be Strings. Each property can have
  • Stream (java.util.stream)
    A sequence of elements supporting sequential and parallel aggregate operations. The following exampl
  • Options (org.apache.commons.cli)
    Main entry-point into the library. Options represents a collection of Option objects, which describ
  • IOUtils (org.apache.commons.io)
    General IO stream manipulation utilities. This class provides static utility methods for input/outpu
  • Top plugins for Android Studio
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