示例#1
0
  /**
   * Return true if the IFile with the given name exists in this project.
   *
   * @param aFileName filename can be relative to one of the input file paths for the
   *     WorkbenchURIConverter.
   * @return <code>true</code> if filename exists in this project
   * @since 1.0.0
   */
  public boolean fileExists(String aFileName) {
    if (aFileName == null) return false;

    IPath path = new Path(aFileName);
    if (path.isAbsolute()) return ResourcesPlugin.getWorkspace().getRoot().getFile(path).exists();
    else return getWorkbenchURIConverter().canGetUnderlyingResource(aFileName);
  }