rename Downloader.inputStream() to getInputStream()

This follows:
URLConnection.getInputStream()
BaseImageDownloader.getStream()
This commit is contained in:
Hans-Christoph Steiner 2014-05-28 18:27:23 -04:00
parent b619716669
commit d19e77049a
2 changed files with 4 additions and 4 deletions

View File

@ -30,7 +30,7 @@ public abstract class Downloader {
public static final String EVENT_PROGRESS = "downloadProgress"; public static final String EVENT_PROGRESS = "downloadProgress";
public abstract InputStream inputStream() throws IOException; public abstract InputStream getInputStream() throws IOException;
// The context is required for opening the file to write to. // The context is required for opening the file to write to.
Downloader(String destFile, Context ctx) Downloader(String destFile, Context ctx)
@ -120,13 +120,13 @@ public abstract class Downloader {
Log.d(TAG, "Downloading from stream"); Log.d(TAG, "Downloading from stream");
InputStream input = null; InputStream input = null;
try { try {
input = inputStream(); input = getInputStream();
// Getting the input stream is slow(ish) for HTTP downloads, so we'll check if // Getting the input stream is slow(ish) for HTTP downloads, so we'll check if
// we were interrupted before proceeding to the download. // we were interrupted before proceeding to the download.
throwExceptionIfInterrupted(); throwExceptionIfInterrupted();
copyInputToOutputStream(inputStream()); copyInputToOutputStream(getInputStream());
} finally { } finally {
Utils.closeQuietly(outputStream); Utils.closeQuietly(outputStream);
Utils.closeQuietly(input); Utils.closeQuietly(input);

View File

@ -40,7 +40,7 @@ public class HttpDownloader extends Downloader {
} }
@Override @Override
public InputStream inputStream() throws IOException { public InputStream getInputStream() throws IOException {
return connection.getInputStream(); return connection.getInputStream();
} }