X-Git-Url: https://git.pterodactylus.net/?a=blobdiff_plain;ds=inline;f=src%2Fmain%2Fjava%2Fnet%2Fpterodactylus%2Fsone%2Fweb%2FGetImagePage.java;h=7fb5cde735f4ec70429017fd3b3a62ec37921b17;hb=7708df5b6f4d1cf1416a8202b825a4f6f78f289e;hp=29556c9a42021d771948417840411c9a8d47cddb;hpb=38cb6c5ec82298ee351d0eb15ddd8331db273af2;p=Sone.git
diff --git a/src/main/java/net/pterodactylus/sone/web/GetImagePage.java b/src/main/java/net/pterodactylus/sone/web/GetImagePage.java
index 29556c9..7fb5cde 100644
--- a/src/main/java/net/pterodactylus/sone/web/GetImagePage.java
+++ b/src/main/java/net/pterodactylus/sone/web/GetImagePage.java
@@ -1,5 +1,5 @@
/*
- * Sone - GetImagePage.java - Copyright © 2011 David Roden
+ * Sone - GetImagePage.java - Copyright © 2011â2013 David Roden
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -18,10 +18,11 @@
package net.pterodactylus.sone.web;
import java.io.IOException;
+import java.net.URI;
import net.pterodactylus.sone.data.TemporaryImage;
+import net.pterodactylus.sone.web.page.FreenetPage;
import net.pterodactylus.sone.web.page.FreenetRequest;
-import net.pterodactylus.util.web.Page;
import net.pterodactylus.util.web.Response;
/**
@@ -29,7 +30,7 @@ import net.pterodactylus.util.web.Response;
*
* @author David âBombeâ Roden
*/
-public class GetImagePage implements Page {
+public class GetImagePage implements FreenetPage {
/** The Sone web interface. */
private final WebInterface webInterface;
@@ -44,25 +45,16 @@ public class GetImagePage implements Page {
this.webInterface = webInterface;
}
- /**
- * {@inheritDoc}
- */
@Override
public String getPath() {
return "getImage.html";
}
- /**
- * {@inheritDoc}
- */
@Override
public boolean isPrefixPage() {
return false;
}
- /**
- * {@inheritDoc}
- */
@Override
public Response handleRequest(FreenetRequest request, Response response) throws IOException {
String imageId = request.getHttpRequest().getParam("image");
@@ -74,4 +66,9 @@ public class GetImagePage implements Page {
return response.setStatusCode(200).setStatusText("OK").setContentType(contentType).addHeader("Content-Disposition", "attachment; filename=" + temporaryImage.getId() + "." + contentType.substring(contentType.lastIndexOf('/') + 1)).write(temporaryImage.getImageData());
}
+ @Override
+ public boolean isLinkExcepted(URI link) {
+ return false;
+ }
+
}