code: public static String getName(String path, boolean ignoreTrailingSlash)
     {
        if (ignoreTrailingSlash && path.endsWith("/") && path.length() > 1)
        {
           path = path.substring(0, path.length() - 1);
        }
        return getName(path);
     }
docs: Same as {@link #getName(String)} but adding the possibility to pass paths that end with a
  trailing '/'
  
  @see #getName(String)