code: public static String getFilename(String path) throws IllegalArgumentException {
          if (Pattern.matches(sPatternUrl, path))
              return getURLFilename(path);
  
          return new File(path).getName();
      }
docs: Gets the filename from a path or URL.
  @param path or url.
  @return the file name.