class FilepathUtils {

  public static String getFilename(final String path) {
    if (null == path) {
      return null;
    }
    final String canonicalPath = getCanonicalForm(path);
    final int index = canonicalPath.lastIndexOf(DIRECTORY_SEPARATOR);

    return (index < 0) ? canonicalPath : canonicalPath.substring(index + 1);
  }

}