Resources { public static String getPathToPackage(final Class clazz) { Package p = clazz.getPackage(); if(p == null) { return "/"; } return "/" + p.getName().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 getPathToPackage() throws Exception { String str; str = Resources.getPathToPackage(Foobar.class); assertEquals("/de/huxhorn/sulky/resources/junit", str); str = Resources.getPathToPackage(Foobar.StaticInternal.class); assertEquals("/de/huxhorn/sulky/resources/junit", str); }