<%@ page import="java.io.File,java.io.FilenameFilter,java.util.Arrays"%> <%@ page trimDirectiveWhitespaces="true" %> <%@ page import="org.crosswire.utils.Utils" %> <%@ page import="org.crosswire.xml.XMLBlock" %> <%@ page import="org.crosswire.utils.HTTPUtils" %> <%@ page import="org.json.JSONTokener" %> <%@ page import="org.json.JSONTokener" %> <%@ page import="org.json.JSONObject" %> <%@ page import="org.json.JSONArray" %> <%@ page import="java.net.URI" %> <% String dir = request.getParameter("dir"); if (dir == null) { return; } String manifestURL = dir; /* int keySlash = dir.lastIndexOf("/"); if (keySlash > 0) manifestURL = dir.substring(0, keySlash); if (manifestURL == null) { return; } if (key.startsWith("http")) { key = null; } else { dir = dir.substring(keySlash); } */ manifestURL = java.net.URLDecoder.decode(manifestURL, "UTF-8"); System.out.println("IIIF Manifest url: " + manifestURL); if (manifestURL.endsWith("/")) manifestURL = manifestURL.substring(0, manifestURL.length()-1); try { java.lang.System.setProperty("https.protocols", "TLSv1,TLSv1.1,TLSv1.2"); URI uri = new URI(manifestURL); JSONTokener tokener = new JSONTokener(uri.toURL().openStream()); JSONObject root = new JSONObject(tokener); //System.out.println("IIIF Manifest root: " + root); out.print(""); } catch (Exception e) { e.printStackTrace(); } %>