Skip to content

Commit 89f354a

Browse files
committedJul 17, 2013
add DMCA notice in FileDownloadController
1 parent 92de553 commit 89f354a

File tree

1 file changed

+11
-3
lines changed

1 file changed

+11
-3
lines changed
 

‎src/java/edu/psu/citeseerx/web/FileDownloadController.java

+11-3
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@
3131
* Process a request to download a file, sending the file to the user. If for
3232
* some reason the file is not found and Internal error is generated.
3333
* @author Isaac Councill
34-
* @version $Rev$ $Date$
34+
* @version $Rev: 81 $ $Date: 2011-01-14 17:37:35 -0500 (Fri, 14 Jan 2011) $
3535
*/
3636
public class FileDownloadController implements Controller {
3737

@@ -52,6 +52,7 @@ public ModelAndView handleRequest(HttpServletRequest request,
5252
String type = request.getParameter("type");
5353
String urlIndex = request.getParameter("i");
5454

55+
5556
Map<String, Object> model = new HashMap<String, Object>();
5657
if (doi == null || type == null) {
5758
String errorTitle = "Document Not Found";
@@ -71,6 +72,13 @@ public ModelAndView handleRequest(HttpServletRequest request,
7172
e.printStackTrace();
7273
}
7374

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+
}
7482
if (doc == null || doc.isPublic() == false) {
7583
String errorTitle = "Document Not Found";
7684
model.put("doi", doi);
@@ -102,8 +110,8 @@ public ModelAndView handleRequest(HttpServletRequest request,
102110
response.reset();
103111
if (type.equalsIgnoreCase("pdf")) {
104112
response.setContentType("application/pdf");
105-
response.setHeader("Content-Disposition",
106-
"attachment; filename=\""+doi+".pdf\"");
113+
// response.setHeader("Content-Disposition",
114+
// "attachment; filename=\""+doi+".pdf\"");
107115
}else if(type.equalsIgnoreCase("ps")) {
108116
response.setContentType("application/ps");
109117
response.setHeader("Content-Disposition",

0 commit comments

Comments
 (0)
Please sign in to comment.