Replace utils’ StreamCopier by Guava’s ByteStreams.
authorDavid ‘Bombe’ Roden <bombe@pterodactylus.net>
Thu, 17 Jan 2013 14:21:13 +0000 (15:21 +0100)
committerDavid ‘Bombe’ Roden <bombe@pterodactylus.net>
Thu, 17 Jan 2013 14:21:13 +0000 (15:21 +0100)
src/main/java/net/pterodactylus/sone/web/UploadImagePage.java

index 8d40416..2800f29 100644 (file)
@@ -36,11 +36,13 @@ import net.pterodactylus.sone.data.TemporaryImage;
 import net.pterodactylus.sone.text.TextFilter;
 import net.pterodactylus.sone.web.page.FreenetRequest;
 import net.pterodactylus.util.io.Closer;
-import net.pterodactylus.util.io.StreamCopier;
 import net.pterodactylus.util.logging.Logging;
 import net.pterodactylus.util.template.Template;
 import net.pterodactylus.util.template.TemplateContext;
 import net.pterodactylus.util.web.Method;
+
+import com.google.common.io.ByteStreams;
+
 import freenet.support.api.Bucket;
 import freenet.support.api.HTTPUploadedFile;
 
@@ -99,7 +101,7 @@ public class UploadImagePage extends SoneTemplatePage {
                                imageInputStream = fileBucket.getInputStream();
                                /* TODO - check length */
                                imageDataOutputStream = new ByteArrayOutputStream((int) fileBucket.size());
-                               StreamCopier.copy(imageInputStream, imageDataOutputStream);
+                               ByteStreams.copy(imageInputStream, imageDataOutputStream);
                        } catch (IOException ioe1) {
                                logger.log(Level.WARNING, "Could not read uploaded image!", ioe1);
                                return;