code: public static String extractClassNameFromFile(final File parentDirectory,
                                                  final File classFile) throws IOException {
      if (null == classFile) {
        return null;
      }
      final String qualifiedFileName = parentDirectory != null
              ? classFile.getCanonicalPath()
                .substring(parentDirectory.getCanonicalPath().length() + 1)
              : classFile.getCanonicalPath();
      return removeExtension(qualifiedFileName.replace(File.separator, "."));
    }
docs: Remove parent directory from file name and replace directory separator with dots.
  
  <ul>
  <li>parentDirectory: {@code /tmp/my/parent/src/}</li>
  <li>classFile: {@code /tmp/my/parent/src/foo/bar/MyApp.class}</li>
  </ul>
  returns: {@code foo.bar.MyApp}
  
  @param parentDirectory to remove from {@code classFile} and maybe {@code null}.
  @param classFile to extract the name from. Maybe {@code null}
  @return class name extracted from file name or {@code null}
  @throws IOException by file operations