UCFPackage extends ODFJaxb implements Cloneable { public ResourceEntry getResourceEntry(String path) { OdfFileEntry odfFileEntry = odfPackage.getManifestEntries().get(path); if (odfFileEntry == null) return null; return new ResourceEntry(odfFileEntry); } UCFPackage();  UCFPackage(File containerFile);  UCFPackage(InputStream inputStream); String getPackageMediaType(); void setPackageMediaType(String mediaType); void save(File packageFile); void addResource(String stringValue, String path, String mediaType); void addResource(byte[] bytesValue, String path, String mediaType); void addResource(Document document, String path, String mediaType); void addResource(InputStream inputStream, String path,
			String mediaType); void addResource(URI uri, String path, String mediaType); String getResourceAsString(String path); byte[] getResourceAsBytes(String path); InputStream getResourceAsInputStream(String path); Map<String, ResourceEntry> listResources(); Map<String, ResourceEntry> listResources(String folderPath); void removeResource(String path); Map<String, ResourceEntry> listAllResources(); void setRootFile(String path); @SuppressWarnings("rawtypes") void setRootFile(String path, String version); @SuppressWarnings("rawtypes") List<ResourceEntry> getRootFiles(); ResourceEntry getResourceEntry(String path); @SuppressWarnings("rawtypes") void unsetRootFile(String path); void save(OutputStream output); OutputStream addResourceUsingOutputStream(String path,
			String mediaType); @Override UCFPackage clone(); String getRootFileVersion(String rootFile); static final String MIME_BINARY; static final String MIME_TEXT_PLAIN; static final String MIME_TEXT_XML; static final String MIME_RDF; static final String MIME_EPUB; static final String MIME_WORKFLOW_BUNDLE; static final String MIME_DATA_BUNDLE; static final String MIME_WORKFLOW_RUN_BUNDLE; static final String MIME_SERVICE_BUNDLE; }
@Test public void getResourceEntry() throws Exception { UCFPackage container = new UCFPackage(); container.setPackageMediaType(UCFPackage.MIME_WORKFLOW_BUNDLE); container.addResource("Hello there", "helloworld.txt", "text/plain"); container.addResource("Sub-folder entry 1", "sub/1.txt", "text/plain"); ResourceEntry helloResource = container .getResourceEntry("helloworld.txt"); assertEquals("helloworld.txt", helloResource.getPath()); assertEquals(11, helloResource.getSize()); assertEquals("text/plain", helloResource.getMediaType()); assertFalse(helloResource.isFolder()); ResourceEntry subResource = container.getResourceEntry("sub/"); assertEquals("sub/", subResource.getPath()); assertEquals(-1, subResource.getSize()); assertEquals("text/plain", subResource.getMediaType()); assertTrue(subResource.isFolder()); container.save(tmpFile); UCFPackage loaded = new UCFPackage(tmpFile); ResourceEntry loadedHelloResource = loaded .getResourceEntry("helloworld.txt"); assertEquals("helloworld.txt", loadedHelloResource.getPath()); assertEquals(11, loadedHelloResource.getSize()); assertEquals("text/plain", loadedHelloResource.getMediaType()); assertFalse(loadedHelloResource.isFolder()); ResourceEntry loadedSubResource = loaded.getResourceEntry("sub/"); assertEquals("sub/", loadedSubResource.getPath()); assertEquals(-1, loadedSubResource.getSize()); assertEquals("text/plain", loadedSubResource.getMediaType()); assertTrue(loadedSubResource.isFolder()); }