From: David ‘Bombe’ Roden Date: Tue, 28 Aug 2012 10:01:35 +0000 (+0200) Subject: Use NullOutputStream from utils. X-Git-Tag: 0.11^2~18 X-Git-Url: https://git.pterodactylus.net/?a=commitdiff_plain;h=967018cd81182ec2fd4f941e271137aadbaa6d81;p=jSite.git Use NullOutputStream from utils. --- diff --git a/src/main/java/de/todesbaum/jsite/gui/FileScanner.java b/src/main/java/de/todesbaum/jsite/gui/FileScanner.java index bd98ed0..cfb0c23 100644 --- a/src/main/java/de/todesbaum/jsite/gui/FileScanner.java +++ b/src/main/java/de/todesbaum/jsite/gui/FileScanner.java @@ -23,7 +23,6 @@ import java.io.FileFilter; import java.io.FileInputStream; import java.io.IOException; import java.io.InputStream; -import java.io.OutputStream; import java.security.DigestOutputStream; import java.security.MessageDigest; import java.security.NoSuchAlgorithmException; @@ -34,6 +33,7 @@ import java.util.logging.Level; import java.util.logging.Logger; import net.pterodactylus.util.io.Closer; +import net.pterodactylus.util.io.NullOutputStream; import net.pterodactylus.util.io.StreamCopier; import de.todesbaum.jsite.application.Project; import de.todesbaum.jsite.i18n.I18n; @@ -184,7 +184,6 @@ public class FileScanner implements Runnable { * The name of the file, relative to the project path * @return The hash of the file */ - @SuppressWarnings("synthetic-access") private static String hashFile(String path, String filename) { InputStream fileInputStream = null; DigestOutputStream digestOutputStream = null; @@ -221,39 +220,6 @@ public class FileScanner implements Runnable { } /** - * {@link OutputStream} that discards all written bytes. - * - * @author David ‘Bombe’ Roden <bombe@freenetproject.org> - */ - private static class NullOutputStream extends OutputStream { - - /** - * {@inheritDoc} - */ - @Override - public void write(int b) { - /* do nothing. */ - } - - /** - * {@inheritDoc} - */ - @Override - public void write(byte[] b) { - /* do nothing. */ - } - - /** - * {@inheritDoc} - */ - @Override - public void write(byte[] b, int off, int len) { - /* do nothing. */ - } - - } - - /** * Container for a scanned file, consisting of the name of the file and its * hash. *