// Path: src/main/java/technology/tabula/tabula_web/JsonTransformer.java
// public class JsonTransformer implements ResponseTransformer {
// 
//     private Gson gson = new Gson();
// 
//     @Override
//     public String render(Object model) {
//         return gson.toJson(model);
//     }
// 
// }
// 
// Path: src/main/java/technology/tabula/tabula_web/workspace/WorkspaceDAO.java
// public interface WorkspaceDAO {
// 	
// 	Workspace getWorkspace() throws WorkspaceException;
// 
// 	void addDocument(WorkspaceDocument we, List<DocumentPage> pages) throws WorkspaceException;
// 
// 	void deleteDocument(String documentId) throws WorkspaceException;
// 
// 	WorkspaceDocument getDocumentMetadata(String documentId) throws WorkspaceException;
// 
// 	List<DocumentPage> getDocumentPages(String documentId) throws WorkspaceException;
// 
// 	String getDocumentPath(String documentId);
// 	
// 	String getDocumentDir(String documentId);
// 
// 	String getDataDir();
// 	
// 	void addFile(InputStream stream, String documentId, String filename) throws WorkspaceException;
// 
// }


import spark.RouteGroup;
import technology.tabula.tabula_web.JsonTransformer;
import technology.tabula.tabula_web.workspace.WorkspaceDAO;
import static spark.Spark.get;
import java.nio.file.Files;
import java.nio.file.Paths;
import javax.servlet.http.HttpServletResponse;
package technology.tabula.tabula_web.routes;






public class PdfsRouteGroup implements RouteGroup {
	
	private WorkspaceDAO workspaceDAO;

	public PdfsRouteGroup(WorkspaceDAO workspaceDAO) {
		this.workspaceDAO = workspaceDAO;
	}

	@Override
	public void addRoutes() {
		get("workspace.json", (req, rsp) -> {
			rsp.type("application/json");
			return this.workspaceDAO.getWorkspace();
// Path: src/main/java/technology/tabula/tabula_web/JsonTransformer.java
// public class JsonTransformer implements ResponseTransformer {
// 
//     private Gson gson = new Gson();
// 
//     @Override
//     public String render(Object model) {
//         return gson.toJson(model);
//     }
// 
// }
// 
// Path: src/main/java/technology/tabula/tabula_web/workspace/WorkspaceDAO.java
// public interface WorkspaceDAO {
// 	
// 	Workspace getWorkspace() throws WorkspaceException;
// 
// 	void addDocument(WorkspaceDocument we, List<DocumentPage> pages) throws WorkspaceException;
// 
// 	void deleteDocument(String documentId) throws WorkspaceException;
// 
// 	WorkspaceDocument getDocumentMetadata(String documentId) throws WorkspaceException;
// 
// 	List<DocumentPage> getDocumentPages(String documentId) throws WorkspaceException;
// 
// 	String getDocumentPath(String documentId);
// 	
// 	String getDocumentDir(String documentId);
// 
// 	String getDataDir();
// 	
// 	void addFile(InputStream stream, String documentId, String filename) throws WorkspaceException;
// 
// }


// Path: src/main/java/technology/tabula/tabula_web/routes/PdfsRouteGroup.java
import spark.RouteGroup;
import technology.tabula.tabula_web.JsonTransformer;
import technology.tabula.tabula_web.workspace.WorkspaceDAO;
import static spark.Spark.get;
import java.nio.file.Files;
import java.nio.file.Paths;
import javax.servlet.http.HttpServletResponse;

package technology.tabula.tabula_web.routes;






public class PdfsRouteGroup implements RouteGroup {
	
	private WorkspaceDAO workspaceDAO;

	public PdfsRouteGroup(WorkspaceDAO workspaceDAO) {
		this.workspaceDAO = workspaceDAO;
	}

	@Override
	public void addRoutes() {
		get("workspace.json", (req, rsp) -> {
			rsp.type("application/json");
			return this.workspaceDAO.getWorkspace();
		}, new JsonTransformer());