@Test @DisplayName("Try to get the size of resources from an invalid file type") void getResourceSize_4() { assertThrows(IOException.class, () -> getResourceSize(new File("src/test/resources/small_file.txt"), "META-INF/MANIFEST.MF")); assertThrows(IOException.class, () -> getResourceSize(new File("src/test/resources"), "META-INF/MANIFEST.MF")); }
public static long getResourceSize(Path file, String resource) throws IOException { checkNotNull(resource); checkNotNull(file); URL url = getResourceUrl(file, resource); if (url == null) throw new IOException(); return Resources.asByteSource(url).size(); }
JarUtil { public static long getResourceSize(Path file, String resource) throws IOException { checkNotNull(resource); checkNotNull(file); URL url = getResourceUrl(file, resource); if (url == null) throw new IOException(); return Resources.asByteSource(url).size(); } }
JarUtil { public static long getResourceSize(Path file, String resource) throws IOException { checkNotNull(resource); checkNotNull(file); URL url = getResourceUrl(file, resource); if (url == null) throw new IOException(); return Resources.asByteSource(url).size(); } private  JarUtil(); }
JarUtil { public static long getResourceSize(Path file, String resource) throws IOException { checkNotNull(resource); checkNotNull(file); URL url = getResourceUrl(file, resource); if (url == null) throw new IOException(); return Resources.asByteSource(url).size(); } private  JarUtil(); static Optional<String> getManifestValue(Path file, String attribute); static Optional<String> getManifestValue(File file, String attribute); static Attributes getManifest(Path file); static Attributes getManifest(File file); static long getResourceSize(Path file, String resource); static long getResourceSize(File file, String resource); static URL getResourceUrl(Path file, String resource); static boolean resourceExists(Path file, String resource); }
JarUtil { public static long getResourceSize(Path file, String resource) throws IOException { checkNotNull(resource); checkNotNull(file); URL url = getResourceUrl(file, resource); if (url == null) throw new IOException(); return Resources.asByteSource(url).size(); } private  JarUtil(); static Optional<String> getManifestValue(Path file, String attribute); static Optional<String> getManifestValue(File file, String attribute); static Attributes getManifest(Path file); static Attributes getManifest(File file); static long getResourceSize(Path file, String resource); static long getResourceSize(File file, String resource); static URL getResourceUrl(Path file, String resource); static boolean resourceExists(Path file, String resource);  }