code: public static String getName(String path)
      {
          if (path == null) throw new IllegalArgumentException("'path' can't be null");
          if (path.length() == 0) return null;
          if (!path.startsWith("/")) throw new IllegalArgumentException("Not a valid path.  Doesn't start with a \"/\": \"" + path + "\"");
          if (path.endsWith("/")) throw new IllegalArgumentException("Not a valid path.  Ends with a \"/\": \"" + path + "\"");
  
          int start = path.length() - 1;
          while (path.charAt(start) != '/') {
              start--;
          }
          return path.substring(start+1);
      }
docs: Returns just the last component of the path.
  <ul>
  <li>{@code getName("")} &rarr; {@code null}</li>
  <li>{@code getName("/Photos")} &rarr; {@code "Photos"}</li>
  <li>{@code getName("/Photos/Home.jpeg")} &rarr; {@code "Home.jpeg"}</li>
  </ul>