UCFPackage extends ODFJaxb implements Cloneable { public void setPackageMediaType(String mediaType) { if (mediaType == null || !mediaType.contains("/")) throw new IllegalArgumentException("Invalid media type " + mediaType); if (!ASCII.newEncoder().canEncode(mediaType)) throw new IllegalArgumentException("Media type must be ASCII: " + mediaType); odfPackage.setMediaType(mediaType); } 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(expected = IllegalArgumentException.class) public void mimeTypeInvalidCharset() throws Exception { UCFPackage container = new UCFPackage(); container.setPackageMediaType("food/brød"); }
@Test(expected = IllegalArgumentException.class) public void mimeTypeEmpty() throws Exception { UCFPackage container = new UCFPackage(); container.setPackageMediaType(""); }
@Test(expected = IllegalArgumentException.class) public void mimeTypeNoSlash() throws Exception { UCFPackage container = new UCFPackage(); container.setPackageMediaType("nonvalid"); }