git-svn-id: http://svn.research-infrastructures.eu/public/d4science/gcube/trunk/data-transfer/uri-resolver@74040 82a268e6-3cf1-43bd-a215-b396298e98cf
This commit is contained in:
parent
58f91b5637
commit
d7ece67c36
3
pom.xml
3
pom.xml
|
@ -25,14 +25,12 @@
|
|||
<groupId>org.gcube.contentmanagement</groupId>
|
||||
<artifactId>storage-manager-wrapper</artifactId>
|
||||
<version>[2.0.0-SNAPSHOT, 3.0.0-SNAPSHOT)</version>
|
||||
<scope>provided</scope>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>org.gcube.contentmanagement</groupId>
|
||||
<artifactId>storage-manager-core</artifactId>
|
||||
<version>[2.0.0-SNAPSHOT,3.0.0-SNAPSHOT)</version>
|
||||
<scope>provided</scope>
|
||||
<exclusions>
|
||||
<exclusion>
|
||||
<artifactId>slf4j-nop</artifactId>
|
||||
|
@ -44,6 +42,7 @@
|
|||
<groupId>javax.servlet</groupId>
|
||||
<artifactId>javax.servlet-api</artifactId>
|
||||
<version>3.0.1</version>
|
||||
<scope>provided</scope>
|
||||
|
||||
</dependency>
|
||||
<dependency>
|
||||
|
|
|
@ -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;
|
||||
|
||||
|
|
Loading…
Reference in New Issue