public class Pinch
extends java.lang.Object
| Modifier and Type | Class and Description |
|---|---|
static interface |
Pinch.ProgressListener |
| Modifier and Type | Field and Description |
|---|---|
static java.lang.String |
LOG_TAG |
| Constructor and Description |
|---|
Pinch(java.net.URL url)
Class constructor.
|
Pinch(java.net.URL url,
java.lang.String userAgent)
Class constructor.
|
| Modifier and Type | Method and Description |
|---|---|
void |
downloadFile(ExtendedZipEntry entry)
|
void |
downloadFile(ExtendedZipEntry entry,
java.lang.String dir) |
void |
downloadFile(ExtendedZipEntry entry,
java.lang.String dir,
Pinch.ProgressListener listener)
Wrapper method for
downloadFile(ExtendedZipEntry, String, String, guru.benson.pinch.Pinch.ProgressListener)
where name is extracted from entry. |
void |
downloadFile(ExtendedZipEntry entry,
java.lang.String dir,
java.lang.String name,
Pinch.ProgressListener listener)
Download and inflate file from a ZIP stored on a HTTP server.
|
java.util.ArrayList<ExtendedZipEntry> |
parseCentralDirectory()
Gets the list of files included in the ZIP stored on the HTTP server.
|
public Pinch(java.net.URL url)
url - The URL pointing to the ZIP file on the HTTP server.public Pinch(java.net.URL url,
java.lang.String userAgent)
url - The URL pointing to the ZIP file on the HTTP server.userAgent - User-agent to be used together with the download request.public java.util.ArrayList<ExtendedZipEntry> parseCentralDirectory()
public void downloadFile(ExtendedZipEntry entry) throws java.io.IOException, java.lang.InterruptedException
java.io.IOExceptionjava.lang.InterruptedExceptionpublic void downloadFile(ExtendedZipEntry entry, java.lang.String dir) throws java.io.IOException, java.lang.InterruptedException
java.io.IOExceptionjava.lang.InterruptedExceptionpublic void downloadFile(ExtendedZipEntry entry, java.lang.String dir, Pinch.ProgressListener listener) throws java.io.IOException, java.lang.InterruptedException
downloadFile(ExtendedZipEntry, String, String, guru.benson.pinch.Pinch.ProgressListener)
where name is extracted from entry.java.io.IOExceptionjava.lang.InterruptedExceptionpublic void downloadFile(ExtendedZipEntry entry, java.lang.String dir, java.lang.String name, Pinch.ProgressListener listener) throws java.io.IOException, java.lang.InterruptedException
entry - Entry representing file to download.name - Path where to store the downloaded file.listener - java.io.IOException - If an error occurred while reading from network or writing to disk.java.lang.InterruptedException - If the thread was interrupted.