@ Nonnull public static String extractPackageName ( @ Nonnull final String fileNameWithoutExtension ) { final int lastDot = fileNameWithoutExtension . lastIndexOf ( ' ' ) ; if ( lastDot < 0 ) { return "" ; } return fileNameWithoutExtension . substring ( 0 , lastDot ) . trim ( ) ; }
Extract package name from canonical Java class name