@Override
	public List<File> exportDiagrams(File suggestedFile, FileFormatOption fileFormat) throws IOException,
			InterruptedException {
		if (suggestedFile.exists() && suggestedFile.isDirectory()) {
			throw new IllegalArgumentException("File is a directory " + suggestedFile);
		}

		if (fileFormat.getFileFormat() == FileFormat.HTML) {
			return createFilesHtml(suggestedFile);
		}

		final StringBuilder cmap = new StringBuilder();
		OutputStream os = null;
		try {
			os = new BufferedOutputStream(new FileOutputStream(suggestedFile));
			this.exportDiagram(os, cmap, 0, fileFormat);
		} finally {
			if (os != null) {
				os.close();
			}
		}
		List<File> result = Arrays.asList(suggestedFile);

		if (this.hasUrl() && cmap.length() > 0) {
			exportCmap(suggestedFile, cmap);
		}

		if (fileFormat.getFileFormat() == FileFormat.PNG) {
			result = new PngSplitter(suggestedFile, this.getHorizontalPages(), this.getVerticalPages(),
					this.getMetadata(), this.getDpi(fileFormat)).getFiles();
		}
		return result;

	}