31
31
* Process a request to download a file, sending the file to the user. If for
32
32
* some reason the file is not found and Internal error is generated.
33
33
* @author Isaac Councill
34
- * @version $Rev$ $Date$
34
+ * @version $Rev: 81 $ $Date: 2011-01-14 17:37:35 -0500 (Fri, 14 Jan 2011) $
35
35
*/
36
36
public class FileDownloadController implements Controller {
37
37
@@ -52,6 +52,7 @@ public ModelAndView handleRequest(HttpServletRequest request,
52
52
String type = request .getParameter ("type" );
53
53
String urlIndex = request .getParameter ("i" );
54
54
55
+
55
56
Map <String , Object > model = new HashMap <String , Object >();
56
57
if (doi == null || type == null ) {
57
58
String errorTitle = "Document Not Found" ;
@@ -71,6 +72,13 @@ public ModelAndView handleRequest(HttpServletRequest request,
71
72
e .printStackTrace ();
72
73
}
73
74
75
+ if (doc .isDMCA () == true ) {
76
+ String dmcaTitle = "DMCA Notice" ;
77
+ model .put ("doi" , doi );
78
+ model .put ("pagetitle" , dmcaTitle );
79
+ return new ModelAndView ("dmcaPage" , model );
80
+
81
+ }
74
82
if (doc == null || doc .isPublic () == false ) {
75
83
String errorTitle = "Document Not Found" ;
76
84
model .put ("doi" , doi );
@@ -102,8 +110,8 @@ public ModelAndView handleRequest(HttpServletRequest request,
102
110
response .reset ();
103
111
if (type .equalsIgnoreCase ("pdf" )) {
104
112
response .setContentType ("application/pdf" );
105
- response .setHeader ("Content-Disposition" ,
106
- "attachment; filename=\" " +doi +".pdf\" " );
113
+ // response.setHeader("Content-Disposition",
114
+ // "attachment; filename=\""+doi+".pdf\"");
107
115
}else if (type .equalsIgnoreCase ("ps" )) {
108
116
response .setContentType ("application/ps" );
109
117
response .setHeader ("Content-Disposition" ,
0 commit comments