code: public static String getClassName(String resourceName) {
      if (!resourceName.endsWith(".class")) {
        throw new IllegalArgumentException("resourceName does not refer to a class");
      }
      int len = resourceName.length();
      return resourceName.substring(0, len - 6).replace('/', '.');
    }
docs: Gets the class name associated with a given resource name.  If the
  full path to the resource is given, the fully qualified name is
  returned.
  @param resourceName The name of the resource.
  @return The name of the associated class.