|
|
|
@ -5,6 +5,7 @@ import java.io.InputStream;
|
|
|
|
|
import java.io.OutputStream;
|
|
|
|
|
import java.net.URL;
|
|
|
|
|
import java.net.URLConnection;
|
|
|
|
|
import java.net.URLStreamHandler;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
import javax.servlet.ServletConfig;
|
|
|
|
@ -15,6 +16,7 @@ import javax.servlet.http.HttpServletResponse;
|
|
|
|
|
|
|
|
|
|
import org.apache.commons.io.IOUtils;
|
|
|
|
|
import org.gcube.contentmanager.storageclient.model.protocol.smp.Handler;
|
|
|
|
|
import org.gcube.contentmanager.storageclient.model.protocol.smp.SMPURLConnection;
|
|
|
|
|
import org.slf4j.Logger;
|
|
|
|
|
import org.slf4j.LoggerFactory;
|
|
|
|
|
|
|
|
|
@ -40,6 +42,7 @@ public class HttpResolver extends HttpServlet {
|
|
|
|
|
|
|
|
|
|
protected void doGet(HttpServletRequest request,
|
|
|
|
|
HttpServletResponse response) throws IOException {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
logger.info("The http session id is: " + request.getSession().getId());
|
|
|
|
|
|
|
|
|
@ -66,8 +69,15 @@ public class HttpResolver extends HttpServlet {
|
|
|
|
|
|
|
|
|
|
response.addHeader("content-disposition", "attachment; filename=" +name);
|
|
|
|
|
response.setContentType("unknown/unknown");
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
URL url = new URL(uri);
|
|
|
|
|
URL url = new URL(null, uri, new URLStreamHandler() {
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
protected URLConnection openConnection(URL u) throws IOException {
|
|
|
|
|
return new SMPURLConnection(u);
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
URLConnection uc = null;
|
|
|
|
|
|
|
|
|
|