public void writeMetaData(Writer writer) throws Exception {
if (!found) {
writer.write("no metadata has been embedded");
writer.write("\n");
} else {
EmbeddedData embeddedData = new EmbeddedData();
try {
embeddedData.setData((HashMap) metaTag.getMetaData());
writer.write(embeddedData.printMetaData());
writer.write("\n");
} catch (Exception e) {
writer.write("An error occurred while parsing metadata ... try re-embedding");
if (debug) writer.write(e.getMessage());
}