// Path: latex-renderer/src/main/java/de/vsfexperts/latex/storage/Archive.java
// public interface Archive {
// 
// 	/**
// 	 * Stores the contents of the file in the archive. The filename is used by the archive to identify the object.
// 	 *
// 	 * @param id
// 	 *            to identify archive
// 	 * @param file
// 	 *            to be stored
// 	 */
// 	void store(UUID id, File file) throws ArchiveException;
// 
// 	/**
// 	 * Deletes an archived object
// 	 *
// 	 * @param id
// 	 *            of archive
// 	 * @param name
// 	 *            of object to delete
// 	 */
// 	void delete(UUID id, String name) throws ArchiveException;
// 
// 	/**
// 	 * List content of archive
// 	 *
// 	 * @param id
// 	 * @return List of objects
// 	 */
// 	List<String> list(UUID id);
// 
// 	/**
// 	 * Returns an archived object
// 	 *
// 	 * @param id
// 	 *            of archive
// 	 * @param name
// 	 *            of object
// 	 * @return file pointing to storage location
// 	 */
// 	Optional<File> get(UUID id, String name);
// 
// }
// 
// Path: latex-renderer/src/main/java/de/vsfexperts/latex/storage/LocalFileSystemStorage.java
// public class LocalFileSystemStorage {
// 
// 	private final String baseDirectory;
// 
// 	public LocalFileSystemStorage() {
// 		this(FileUtils.getTempDirectoryPath());
// 	}
// 
// 	public LocalFileSystemStorage(final File baseDirectory) {
// 		this(baseDirectory.getAbsolutePath());
// 	}
// 
// 	public LocalFileSystemStorage(final String baseDirectory) {
// 		this.baseDirectory = baseDirectory;
// 	}
// 
// 	public File getBaseDirectory(final UUID jobId) throws FileSystemException {
// 		requireNonNull(jobId);
// 
// 		final File jobDirectory = new File(getGlobalBaseDirectory(), jobId.toString());
// 
// 		try {
// 			FileUtils.forceMkdir(jobDirectory);
// 		} catch (final IOException e) {
// 			throw new FileSystemException(e);
// 		}
// 
// 		return jobDirectory;
// 	}
// 
// 	private File getGlobalBaseDirectory() throws FileSystemException {
// 		final File globalBaseDirectory = new File(baseDirectory);
// 		try {
// 			FileUtils.forceMkdir(globalBaseDirectory);
// 		} catch (final IOException e) {
// 			throw new FileSystemException(e);
// 		}
// 		return globalBaseDirectory;
// 	}
// 
// 	public File createFile(final UUID jobId, final String filename, final String content) throws FileSystemException {
// 		requireNonNull(jobId);
// 		requireNonNull(filename);
// 
// 		final File finalFile = new File(getBaseDirectory(jobId), filename);
// 		final File tempFile = new File(getBaseDirectory(jobId), filename + ".tmp");
// 
// 		try {
// 			FileUtils.write(tempFile, content, Charset.forName("UTF-8"));
// 			FileUtils.moveFile(tempFile, finalFile);
// 		} catch (final IOException e) {
// 			throw new FileSystemException(e);
// 		}
// 
// 		return finalFile;
// 	}
// 
// 	public void addFile(final UUID jobId, final File file) throws FileSystemException {
// 		requireNonNull(jobId);
// 		requireNonNull(file);
// 
// 		final File finalFile = new File(getBaseDirectory(jobId), file.getName());
// 		final File tempFile = new File(getBaseDirectory(jobId), file.getName() + ".tmp");
// 
// 		try {
// 			FileUtils.copyFile(file, tempFile, true);
// 			FileUtils.moveFile(tempFile, finalFile);
// 		} catch (final IOException e) {
// 			throw new FileSystemException(e);
// 		}
// 	}
// 
// 	public Optional<File> getFile(final UUID jobId, final String filename) throws FileSystemException {
// 		requireNonNull(jobId);
// 		requireNonNull(filename);
// 
// 		final File file = new File(getBaseDirectory(jobId), filename);
// 
// 		if (!file.exists()) {
// 			return Optional.empty();
// 		}
// 
// 		return Optional.of(file);
// 	}
// 
// 	public List<String> list(final UUID jobId) {
// 		requireNonNull(jobId);
// 		return Arrays.stream(getBaseDirectory(jobId).listFiles()).map(File::getName).collect(Collectors.toList());
// 	}
// 
// 	public void delete(final UUID jobId, final String filename) throws FileSystemException {
// 		requireNonNull(jobId);
// 		requireNonNull(filename);
// 
// 		try {
// 			FileUtils.forceDelete(new File(getBaseDirectory(jobId), filename));
// 		} catch (final IOException e) {
// 			throw new FileSystemException(e);
// 		}
// 	}
// 
// 	public void delete(final UUID jobId) throws FileSystemException {
// 		requireNonNull(jobId);
// 
// 		try {
// 			FileUtils.forceDelete(getBaseDirectory(jobId));
// 		} catch (final Exception e) {
// 			throw new FileSystemException(e);
// 		}
// 	}
// 
// 	public void deleteFiles(final UUID jobId, final Predicate<String> filenamePredicate) {
// 		final FileFilter filter = f -> f.isFile() && filenamePredicate.test(f.getName());
// 		Arrays.stream(getBaseDirectory(jobId).listFiles(filter)).forEach(File::delete);
// 	}
// 
// 	public void clear() throws FileSystemException {
// 		try {
// 			FileUtils.cleanDirectory(getGlobalBaseDirectory());
// 		} catch (final Exception e) {
// 			throw new FileSystemException(e);
// 		}
// 	}
// 
// }


import java.util.concurrent.Executor;
import de.vsfexperts.latex.storage.Archive;
import de.vsfexperts.latex.storage.LocalFileSystemStorage;
package de.vsfexperts.latex.renderer;



/**
 * Single threaded renderer. This renderer is using the current thread to render the file in a synchronous way.
 */
public class SynchronousLatexRenderer extends GenericLatexRenderer {

	private static final DirectExecutor DIRECT_EXECUTOR = new DirectExecutor();

	public SynchronousLatexRenderer() {
	}

// Path: latex-renderer/src/main/java/de/vsfexperts/latex/storage/Archive.java
// public interface Archive {
// 
// 	/**
// 	 * Stores the contents of the file in the archive. The filename is used by the archive to identify the object.
// 	 *
// 	 * @param id
// 	 *            to identify archive
// 	 * @param file
// 	 *            to be stored
// 	 */
// 	void store(UUID id, File file) throws ArchiveException;
// 
// 	/**
// 	 * Deletes an archived object
// 	 *
// 	 * @param id
// 	 *            of archive
// 	 * @param name
// 	 *            of object to delete
// 	 */
// 	void delete(UUID id, String name) throws ArchiveException;
// 
// 	/**
// 	 * List content of archive
// 	 *
// 	 * @param id
// 	 * @return List of objects
// 	 */
// 	List<String> list(UUID id);
// 
// 	/**
// 	 * Returns an archived object
// 	 *
// 	 * @param id
// 	 *            of archive
// 	 * @param name
// 	 *            of object
// 	 * @return file pointing to storage location
// 	 */
// 	Optional<File> get(UUID id, String name);
// 
// }
// 
// Path: latex-renderer/src/main/java/de/vsfexperts/latex/storage/LocalFileSystemStorage.java
// public class LocalFileSystemStorage {
// 
// 	private final String baseDirectory;
// 
// 	public LocalFileSystemStorage() {
// 		this(FileUtils.getTempDirectoryPath());
// 	}
// 
// 	public LocalFileSystemStorage(final File baseDirectory) {
// 		this(baseDirectory.getAbsolutePath());
// 	}
// 
// 	public LocalFileSystemStorage(final String baseDirectory) {
// 		this.baseDirectory = baseDirectory;
// 	}
// 
// 	public File getBaseDirectory(final UUID jobId) throws FileSystemException {
// 		requireNonNull(jobId);
// 
// 		final File jobDirectory = new File(getGlobalBaseDirectory(), jobId.toString());
// 
// 		try {
// 			FileUtils.forceMkdir(jobDirectory);
// 		} catch (final IOException e) {
// 			throw new FileSystemException(e);
// 		}
// 
// 		return jobDirectory;
// 	}
// 
// 	private File getGlobalBaseDirectory() throws FileSystemException {
// 		final File globalBaseDirectory = new File(baseDirectory);
// 		try {
// 			FileUtils.forceMkdir(globalBaseDirectory);
// 		} catch (final IOException e) {
// 			throw new FileSystemException(e);
// 		}
// 		return globalBaseDirectory;
// 	}
// 
// 	public File createFile(final UUID jobId, final String filename, final String content) throws FileSystemException {
// 		requireNonNull(jobId);
// 		requireNonNull(filename);
// 
// 		final File finalFile = new File(getBaseDirectory(jobId), filename);
// 		final File tempFile = new File(getBaseDirectory(jobId), filename + ".tmp");
// 
// 		try {
// 			FileUtils.write(tempFile, content, Charset.forName("UTF-8"));
// 			FileUtils.moveFile(tempFile, finalFile);
// 		} catch (final IOException e) {
// 			throw new FileSystemException(e);
// 		}
// 
// 		return finalFile;
// 	}
// 
// 	public void addFile(final UUID jobId, final File file) throws FileSystemException {
// 		requireNonNull(jobId);
// 		requireNonNull(file);
// 
// 		final File finalFile = new File(getBaseDirectory(jobId), file.getName());
// 		final File tempFile = new File(getBaseDirectory(jobId), file.getName() + ".tmp");
// 
// 		try {
// 			FileUtils.copyFile(file, tempFile, true);
// 			FileUtils.moveFile(tempFile, finalFile);
// 		} catch (final IOException e) {
// 			throw new FileSystemException(e);
// 		}
// 	}
// 
// 	public Optional<File> getFile(final UUID jobId, final String filename) throws FileSystemException {
// 		requireNonNull(jobId);
// 		requireNonNull(filename);
// 
// 		final File file = new File(getBaseDirectory(jobId), filename);
// 
// 		if (!file.exists()) {
// 			return Optional.empty();
// 		}
// 
// 		return Optional.of(file);
// 	}
// 
// 	public List<String> list(final UUID jobId) {
// 		requireNonNull(jobId);
// 		return Arrays.stream(getBaseDirectory(jobId).listFiles()).map(File::getName).collect(Collectors.toList());
// 	}
// 
// 	public void delete(final UUID jobId, final String filename) throws FileSystemException {
// 		requireNonNull(jobId);
// 		requireNonNull(filename);
// 
// 		try {
// 			FileUtils.forceDelete(new File(getBaseDirectory(jobId), filename));
// 		} catch (final IOException e) {
// 			throw new FileSystemException(e);
// 		}
// 	}
// 
// 	public void delete(final UUID jobId) throws FileSystemException {
// 		requireNonNull(jobId);
// 
// 		try {
// 			FileUtils.forceDelete(getBaseDirectory(jobId));
// 		} catch (final Exception e) {
// 			throw new FileSystemException(e);
// 		}
// 	}
// 
// 	public void deleteFiles(final UUID jobId, final Predicate<String> filenamePredicate) {
// 		final FileFilter filter = f -> f.isFile() && filenamePredicate.test(f.getName());
// 		Arrays.stream(getBaseDirectory(jobId).listFiles(filter)).forEach(File::delete);
// 	}
// 
// 	public void clear() throws FileSystemException {
// 		try {
// 			FileUtils.cleanDirectory(getGlobalBaseDirectory());
// 		} catch (final Exception e) {
// 			throw new FileSystemException(e);
// 		}
// 	}
// 
// }


// Path: latex-renderer/src/main/java/de/vsfexperts/latex/renderer/SynchronousLatexRenderer.java
import java.util.concurrent.Executor;
import de.vsfexperts.latex.storage.Archive;
import de.vsfexperts.latex.storage.LocalFileSystemStorage;

package de.vsfexperts.latex.renderer;



/**
 * Single threaded renderer. This renderer is using the current thread to render the file in a synchronous way.
 */
public class SynchronousLatexRenderer extends GenericLatexRenderer {

	private static final DirectExecutor DIRECT_EXECUTOR = new DirectExecutor();

	public SynchronousLatexRenderer() {
	}

	public SynchronousLatexRenderer(final LocalFileSystemStorage storage, final Archive archive) {