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

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

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

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/org.eclipse.jst.jsf.core

private static IPath getFilePath(String baseName) {
  IPath path = new Path(baseName.replace('.', '/'));//$NON-NLS-1$
  path = path.addFileExtension("properties");//$NON-NLS-1$
  return path;
}
origin: org.eclipse.scout.sdk.deps/org.eclipse.core.resources

/**
 * Returns the path of the file in which to snapshot the sync information
 * for the given resource. Should only be called for the workspace root and
 * projects.
 */
public IPath getSyncInfoSnapshotLocationFor(IResource resource) {
  return getSyncInfoLocationFor(resource).addFileExtension(F_SNAP_EXTENSION);
}
origin: org.eclipse.platform/org.eclipse.core.resources

/**
 * Returns the path of the file in which to snapshot markers for the given
 * resource. Should only be called for the workspace root and projects.
 */
public IPath getMarkersSnapshotLocationFor(IResource resource) {
  return getMarkersLocationFor(resource).addFileExtension(F_SNAP_EXTENSION);
}
origin: org.eclipse.platform/org.eclipse.core.resources

/**
 * Returns the path of the file in which to snapshot the sync information
 * for the given resource. Should only be called for the workspace root and
 * projects.
 */
public IPath getSyncInfoSnapshotLocationFor(IResource resource) {
  return getSyncInfoLocationFor(resource).addFileExtension(F_SNAP_EXTENSION);
}
origin: at.bestsolution.efxclipse.eclipse/org.eclipse.core.resources

/**
 * Returns the path of the file in which to snapshot the sync information
 * for the given resource. Should only be called for the workspace root and
 * projects.
 */
public IPath getSyncInfoSnapshotLocationFor(IResource resource) {
  return getSyncInfoLocationFor(resource).addFileExtension(F_SNAP_EXTENSION);
}
origin: org.eclipse.scout.sdk.deps/org.eclipse.core.resources

/**
 * Returns the path of the file in which to snapshot markers for the given
 * resource. Should only be called for the workspace root and projects.
 */
public IPath getMarkersSnapshotLocationFor(IResource resource) {
  return getMarkersLocationFor(resource).addFileExtension(F_SNAP_EXTENSION);
}
origin: at.bestsolution.efxclipse.eclipse/org.eclipse.core.resources

/**
 * Returns the path of the file in which to snapshot markers for the given
 * resource. Should only be called for the workspace root and projects.
 */
public IPath getMarkersSnapshotLocationFor(IResource resource) {
  return getMarkersLocationFor(resource).addFileExtension(F_SNAP_EXTENSION);
}
origin: org.eclipse.jdt/org.eclipse.jdt.core

protected void removeClassFile(IPath typePath, IContainer outputFolder) throws CoreException {
  if (typePath.lastSegment().indexOf('$') == -1) { // is not a nested type
    this.newState.removeQualifiedTypeName(typePath.toString());
    // add dependents even when the type thinks it does not exist to be on the safe side
    if (JavaBuilder.DEBUG)
      System.out.println("Found removed type " + typePath); //$NON-NLS-1$
    addDependentsOf(typePath, true); // when member types are removed, their enclosing type is structurally changed
  }
  IFile classFile = outputFolder.getFile(typePath.addFileExtension(SuffixConstants.EXTENSION_class));
  if (classFile.exists()) {
    if (JavaBuilder.DEBUG)
      System.out.println("Deleting class file of removed type " + typePath); //$NON-NLS-1$
    classFile.delete(IResource.FORCE, null);
  }
}

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.tycho/org.eclipse.jdt.core

protected char[] writeClassFile(ClassFile classFile, SourceFile compilationUnit, boolean isTopLevelType) throws CoreException {
  String fileName = new String(classFile.fileName()); // the qualified type name "p1/p2/A"
  IPath filePath = new Path(fileName);
  IContainer outputFolder = compilationUnit.sourceLocation.binaryFolder;
  IContainer container = outputFolder;
  if (filePath.segmentCount() > 1) {
    container = createFolder(filePath.removeLastSegments(1), outputFolder);
    filePath = new Path(filePath.lastSegment());
  }

  IFile file = container.getFile(filePath.addFileExtension(SuffixConstants.EXTENSION_class));
  writeClassFileContents(classFile, file, fileName, isTopLevelType, compilationUnit);
  // answer the name of the class file as in Y or Y$M
  return filePath.lastSegment().toCharArray();
}

origin: org.eclipse.jdt/org.eclipse.jdt.core

protected char[] writeClassFile(ClassFile classFile, SourceFile compilationUnit, boolean isTopLevelType) throws CoreException {
  String fileName = new String(classFile.fileName()); // the qualified type name "p1/p2/A"
  IPath filePath = new Path(fileName);
  IContainer outputFolder = compilationUnit.sourceLocation.binaryFolder;
  IContainer container = outputFolder;
  if (filePath.segmentCount() > 1) {
    container = createFolder(filePath.removeLastSegments(1), outputFolder);
    filePath = new Path(filePath.lastSegment());
  }

  IFile file = container.getFile(filePath.addFileExtension(SuffixConstants.EXTENSION_class));
  writeClassFileContents(classFile, file, fileName, isTopLevelType, compilationUnit);
  // answer the name of the class file as in Y or Y$M
  return filePath.lastSegment().toCharArray();
}

origin: org.eclipse.scout.sdk.deps/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

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

/**
 * 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);
}
org.eclipse.core.runtimeIPathaddFileExtension

Javadoc

Returns a new path which is the same as this path but with the given file extension added. If this path is empty, root or has a trailing separator, this path is returned. If this path already has an extension, the existing extension is left and the given extension simply appended. Clients wishing to replace the current extension should first remove the extension and then add the desired one.

The file extension portion is defined as the string following the last period (".") character in the last segment. The given extension should not include a leading ".".

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

  • Updating database using SQL prepared statement
  • addToBackStack (FragmentTransaction)
  • getContentResolver (Context)
  • findViewById (Activity)
  • Proxy (java.net)
    This class represents proxy server settings. A created instance of Proxy stores a type and an addres
  • Time (java.sql)
    Java representation of an SQL TIME value. Provides utilities to format and parse the time's represen
  • Collections (java.util)
    This class consists exclusively of static methods that operate on or return collections. It contains
  • SortedSet (java.util)
    SortedSet is a Set which iterates over its elements in a sorted order. The order is determined eithe
  • Collectors (java.util.stream)
  • XPath (javax.xml.xpath)
    XPath provides access to the XPath evaluation environment and expressions. Evaluation of XPath Expr
  • CodeWhisperer alternatives
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