/** * Returns the basename name without folder path * @param file name, eg. obtained from {@link FileObjects#getPath} or {java.io.File.getPath} * @return the base name * @see #getBaseName(String,char) */ public static String getBaseName( String fileName ) { return getBaseName(fileName, File.separatorChar); }
private static String getSimpleName( String fileName ) { String name = getBaseName( fileName ); int i = name.lastIndexOf( '$' ); if ( i == -1 ) { return name; } else { return name.substring( i + 1 ); } } //</editor-fold>
@Override public String getName(boolean includeExtension) { String name = super.getName(includeExtension); if (name == null) { name = FileObjects.getBaseName(path.getPath(),NBFS_SEPARATOR_CHAR); if (!includeExtension) { name = FileObjects.stripExtension(name); } } return name; }