/** * Get an Archive entry resource URL. * @param resName Entry resource name. * @return The entry resource URL, or null if the entry is not in the Archive. */ public URL getEntryURL(String resName) { File entry = getEntry(resName); if (entry != null) { try { return entry.toURI().toURL(); } catch (MalformedURLException e) { throw new IllegalStateException("Unexpected error getting URL for Archive file '" + entry.getAbsolutePath() + "'.", e); } } else { return null; } }
/** * Get an Archive entry resource URL. * @param resName Entry resource name. * @return The entry resource URL, or null if the entry is not in the Archive. */ public URL getEntryURL(String resName) { File entry = getEntry(resName); if (entry != null) { try { return entry.toURI().toURL(); } catch (MalformedURLException e) { throw new IllegalStateException("Unexpected error getting URL for Archive file '" + entry.getAbsolutePath() + "'.", e); } } else { return null; } }
/** * Get an Archive entry resource URL. * @param resName Entry resource name. * @return The entry resource URL, or null if the entry is not in the Archive. */ public URL getEntryURL(String resName) { File entry = getEntry(resName); if (entry != null) { try { return entry.toURI().toURL(); } catch (MalformedURLException e) { throw new IllegalStateException("Unexpected error getting URL for Archive file '" + entry.getAbsolutePath() + "'.", e); } } else { return null; } }
/** * Get an Archive entries bytes. * @param resName Entry resource name. * @return The bytes, or null if the entry is not in the Archive. */ public byte[] getEntryBytes(String resName) { File entryFile = getEntry(resName); if (entryFile != null) { try { return FileUtils.readFile(entryFile); } catch (IOException e) { throw new IllegalStateException("Unexpected error reading Archive file '" + entryFile.getAbsolutePath() + "'.", e); } } else { return null; } }
/** * Get an Archive entries bytes. * @param resName Entry resource name. * @return The bytes, or null if the entry is not in the Archive. */ public byte[] getEntryBytes(String resName) { File entryFile = getEntry(resName); if (entryFile != null) { try { return FileUtils.readFile(entryFile); } catch (IOException e) { throw new IllegalStateException("Unexpected error reading Archive file '" + entryFile.getAbsolutePath() + "'.", e); } } else { return null; } }
/** * Get an Archive entries bytes. * @param resName Entry resource name. * @return The bytes, or null if the entry is not in the Archive. */ public byte[] getEntryBytes(String resName) { File entryFile = getEntry(resName); if (entryFile != null) { try { return FileUtils.readFile(entryFile); } catch (IOException e) { throw new IllegalStateException("Unexpected error reading Archive file '" + entryFile.getAbsolutePath() + "'.", e); } } else { return null; } }