/** * Writes the data to the file. Binary data will be added. * * @param file The file to handle. * @param ome The element to write to the file. * @throws Exception Thrown if an error occurred while writing the XML file. */ public void writeFile(File file, OME ome) throws Exception { writeFile(file, ome, true); }
/** * Generates an <code>OME-XML</code> file. * * @param index The type of image to import. One of the constants defined * by this class. * @return The image file. * @throws Exception Thrown if an error occurred. */ private File createImageFile(int index) throws Exception { // First create an image File f = File.createTempFile("tempFileName","." + OME_XML); XMLMockObjects xml = new XMLMockObjects(); XMLWriter writer = new XMLWriter(); if (index == IMAGE_ROI) { writer.writeFile(f, xml.createImageWithROI(), true); } else if (index == IMAGE_ANNOTATED_DATA) { writer.writeFile(f, xml.createImageWithAnnotatedAcquisitionData(), true); } else { writer.writeFile(f, xml.createImageWithAcquisitionData(), true); } return f; }
XMLMockObjects xml = new XMLMockObjects(); XMLWriter writer = new XMLWriter(); writer.writeFile(inFile, xml.createImage(), true);
XMLMockObjects xml = new XMLMockObjects(); XMLWriter writer = new XMLWriter(); writer.writeFile(inFile, xml.createImage(), true);
XMLMockObjects xml = new XMLMockObjects(); XMLWriter writer = new XMLWriter(); writer.writeFile(inFile, xml.createImage(), true);