Resources { public static String getPathToClass(final Class clazz) { String className = clazz.getName(); return "/" + className.replace('.', '/').replace('$', '/'); } private  Resources(); static URL[] getLocalResources(final Class clazz, final String resourceBaseName, final String[] suffixes, final Locale locale); static URL[] getLocalResources(final Class clazz, final String resourceBaseName, final String[] suffixes); static URL[] getLocalResources(final Class clazz, final String resourceName, final Locale locale); static URL[] getLocalResources(final Class clazz, final String resourceName); static URL getLocalResource(final Class clazz, final String resourceBaseName, final String[] suffixes, final Locale locale); static URL getLocalResource(final Class clazz, final String resourceBaseName, final String[] suffixes); static URL getLocalResource(final Class clazz, final String resourceName, final Locale locale); static URL getLocalResource(final Class clazz, final String resourceName); static InputStream getLocalResourceAsStream(final Class clazz, final String resourceBaseName, final String[] suffixes, final Locale locale); static InputStream getLocalResourceAsStream(final Class clazz, final String resourceBaseName, final String[] suffixes); static InputStream getLocalResourceAsStream(final Class clazz, final String resourceName, final Locale locale); static InputStream getLocalResourceAsStream(final Class clazz, final String resourceName); static URL[] getResources(final Class clazz, final String resourceBaseName, final String[] suffixes, final Locale locale); static URL[] getResources(final Class clazz, final String resourceBaseName, final String[] suffixes); static URL[] getResources(final Class clazz, final String resourceName, final Locale locale); static URL[] getResources(final Class clazz, final String resourceName); static URL getResource(final Class clazz, final String resourceBaseName, final String[] suffixes, final Locale locale); static URL getResource(final Class clazz, final String resourceBaseName, final String[] suffixes); static URL getResource(final Class clazz, final String resourceName, final Locale locale); static URL getResource(final Class clazz, final String resourceName); static InputStream getResourceAsStream(final Class clazz, final String resourceBaseName, final String[] suffixes, final Locale locale); static InputStream getResourceAsStream(final Class clazz, final String resourceBaseName, final String[] suffixes); static InputStream getResourceAsStream(final Class clazz, final String resourceName, final Locale locale); static InputStream getResourceAsStream(final Class clazz, final String resourceName); static String getShortClassName(final Class clazz); static String[] getLocaleSuffixArray(final Locale locale); static String[] getSingleLocaleSuffixArray(final Locale locale); static String getPathToClass(final Class clazz); static String getPathToPackage(final Class clazz); static final String LINK_SUFFIX; }
@Test public void getPathToClass() throws Exception { String str; str = Resources.getPathToClass(Foobar.class); assertEquals("/de/huxhorn/sulky/resources/junit/Foobar", str); str = Resources.getPathToClass(Foobar.Internal.class); assertEquals("/de/huxhorn/sulky/resources/junit/Foobar/Internal", str); str = Resources.getPathToClass(Foobar.StaticInternal.Foo.class); assertEquals("/de/huxhorn/sulky/resources/junit/Foobar/StaticInternal/Foo", str); }