@Test public void testResourceToClassName() { assertEquals("test.bla.Class", LoadedLibrary.resourceToClassName("test/bla/Class.class")); try { LoadedLibrary.resourceToClassName("test.clas"); fail("IllegalArgumentException should have been thrown"); } catch (IllegalArgumentException e) { } }
public static String resourceToClassName(String entryName) { if (!entryName.endsWith(".class")) { throw new IllegalArgumentException("This is not a class file!"); } return entryName.replace('/', '.').substring(0, entryName.length() - 6); }
LoadedLibrary { public static String resourceToClassName(String entryName) { if (!entryName.endsWith(".class")) { throw new IllegalArgumentException("This is not a class file!"); } return entryName.replace('/', '.').substring(0, entryName.length() - 6); } }
LoadedLibrary { public static String resourceToClassName(String entryName) { if (!entryName.endsWith(".class")) { throw new IllegalArgumentException("This is not a class file!"); } return entryName.replace('/', '.').substring(0, entryName.length() - 6); } LoadedLibrary(String libraryIdentifier);   LoadedLibrary(LibraryIdentifier lib); }
LoadedLibrary { public static String resourceToClassName(String entryName) { if (!entryName.endsWith(".class")) { throw new IllegalArgumentException("This is not a class file!"); } return entryName.replace('/', '.').substring(0, entryName.length() - 6); } LoadedLibrary(String libraryIdentifier);   LoadedLibrary(LibraryIdentifier lib); LibraryIdentifier getLibraryIdentifier(); abstract URL getResourceAsUrl(String name); String getResourceAsString(String resourceName); byte[] getResourceAsBinary(String resourceName); LibraryIdentifier getIdentifier(); static String classToResourceName(String className); static String resourceToClassName(String entryName); }
LoadedLibrary { public static String resourceToClassName(String entryName) { if (!entryName.endsWith(".class")) { throw new IllegalArgumentException("This is not a class file!"); } return entryName.replace('/', '.').substring(0, entryName.length() - 6); } LoadedLibrary(String libraryIdentifier);   LoadedLibrary(LibraryIdentifier lib); LibraryIdentifier getLibraryIdentifier(); abstract URL getResourceAsUrl(String name); String getResourceAsString(String resourceName); byte[] getResourceAsBinary(String resourceName); LibraryIdentifier getIdentifier(); static String classToResourceName(String className); static String resourceToClassName(String entryName);  }