| Modifier and Type | Class and Description |
|---|---|
| protected static class | Get.
Provide this for Backward Compatibility. |
| public static interface | Get.
Interface implemented for reporting progress of downloading. |
| private class | |
| public static class | Get.
do nothing with progress info |
| public static class | Get.
verbose progress system prints to some output stream |
| Modifier and Type | Field and Description |
|---|---|
| private boolean | |
| private static final int | |
| private static final String | |
| private File | |
| private static final int | |
| private static final FileUtils | |
| private static final String | |
| private Map | |
| private static final String | |
| private static final int | |
| private static final String | |
| private boolean | |
| private boolean | |
| private Mapper | |
| private long | |
| private static final int | |
| private int | |
| private String | |
| private boolean | |
| private static final int | |
| private boolean | |
| private final Resources | |
| private boolean | |
| private String | |
| private String | |
| private boolean | |
| private boolean |
| Access | Constructor and Description |
|---|---|
| public |
| Modifier and Type | Method and Description |
|---|---|
| public void | |
| public void | |
| public void | |
| private void | |
| public Mapper | Returns: a mapper to be configured.Define the mapper to map source to destination files. |
| public boolean | Returns: true for a successful download, false otherwise. The return value is only relevant whenignoreErrors is true, as
when false all failures raise BuildExceptions.level to log at, see logLevel, final Get.Project#log(String, int)progress callback; null for no-callbacks progress
Deprecated
only gets the first configured resource
make a get request, with the supplied progress and logging info.
|
| public boolean | Returns: true for a successful download, false otherwise. The return value is only relevant whenignoreErrors is true, as
when false all failures raise BuildExceptions.the URL to get source, final File the target file dest, final int level to log at, see logLevel, Get.Project#log(String, int)progress callback; null for no-callbacks progressmake a get request, with the supplied progress and logging info. |
| public void | |
| public static boolean | |
| public void | log(final String
The message to be logged. Should not be msg, final int null.The message priority at which this message is to
be logged. msgLevel)Overrides org. |
| public void | setAuthenticateOnRedirect(final boolean
"true" to enable sending the credentials on redirect; "false" otherwise v)If true, credentials are set when following a redirect to a new location. |
| public void | |
| public void | setHttpUseCaches(final boolean
boolean httpUseCache)HTTP connections only - control caching on the HttpUrlConnection: httpConnection.setUseCaches(); if false, do not allow caching on the HttpUrlConnection. |
| public void | setIgnoreErrors(final boolean
if "true" then don't report download errors up to ant v)If true, log errors but do not treat as fatal. |
| public void | setMaxTime(final long
long maxTime)The time in seconds the download is allowed to take before being terminated. |
| public void | |
| public void | |
| public void | setRetries(final int
number of attempts to make r)The number of attempts to make for opening the URI, defaults to 3. |
| public void | setSkipExisting(final boolean
"true" to skip existing destination files s)Skip files that already exist locally. |
| public void | |
| public void | setTryGzipEncoding(boolean
boolean b)Whether to transparently try to reduce bandwidth by telling the server ant would support gzip encoding. |
| public void | setUserAgent(final String
String userAgent)HTTP connections only - set the user-agent to be used when communicating with remote server. |
| public void | |
| public void | setUseTimestamp(final boolean
"true" to enable file time fetching v)If true, conditionally download a file based on the timestamp of the local copy. |
| public void |
| authenticateOnRedirect | back to summary |
|---|---|
| private boolean authenticateOnRedirect | |
| BIG_BUFFER_SIZE | back to summary |
|---|---|
| private static final int BIG_BUFFER_SIZE | |
| DEFAULT_AGENT_PREFIX | back to summary |
|---|---|
| private static final String DEFAULT_AGENT_PREFIX | |
| destination | back to summary |
|---|---|
| private File destination | |
| DOTS_PER_LINE | back to summary |
|---|---|
| private static final int DOTS_PER_LINE | |
| FILE_UTILS | back to summary |
|---|---|
| private static final FileUtils FILE_UTILS | |
| GZIP_CONTENT_ENCODING | back to summary |
|---|---|
| private static final String GZIP_CONTENT_ENCODING | |
| headers | back to summary |
|---|---|
| private Map<String, String> headers | |
| HTTP | back to summary |
|---|---|
| private static final String HTTP | |
| HTTP_MOVED_TEMP | back to summary |
|---|---|
| private static final int HTTP_MOVED_TEMP | |
| HTTPS | back to summary |
|---|---|
| private static final String HTTPS | |
| httpUseCaches | back to summary |
|---|---|
| private boolean httpUseCaches | |
| ignoreErrors | back to summary |
|---|---|
| private boolean ignoreErrors | |
| mapperElement | back to summary |
|---|---|
| private Mapper mapperElement | |
| maxTime | back to summary |
|---|---|
| private long maxTime | |
| NUMBER_RETRIES | back to summary |
|---|---|
| private static final int NUMBER_RETRIES | |
| numberRetries | back to summary |
|---|---|
| private int numberRetries | |
| pword | back to summary |
|---|---|
| private String pword | |
| quiet | back to summary |
|---|---|
| private boolean quiet | |
| REDIRECT_LIMIT | back to summary |
|---|---|
| private static final int REDIRECT_LIMIT | |
| skipExisting | back to summary |
|---|---|
| private boolean skipExisting | |
| sources | back to summary |
|---|---|
| private final Resources sources | |
| tryGzipEncoding | back to summary |
|---|---|
| private boolean tryGzipEncoding | |
| uname | back to summary |
|---|---|
| private String uname | |
| userAgent | back to summary |
|---|---|
| private String userAgent | |
| useTimestamp | back to summary |
|---|---|
| private boolean useTimestamp | |
| verbose | back to summary |
|---|---|
| private boolean verbose | |
| Get | back to summary |
|---|---|
| public Get() | |
| add | back to summary |
|---|---|
| public void add(final ResourceCollection rc) Adds URLs to get.
| |
| add | back to summary |
|---|---|
| public void add(final FileNameMapper fileNameMapper) Add a nested filenamemapper.
| |
| addConfiguredHeader | back to summary |
|---|---|
| public void addConfiguredHeader(Header header) Add a nested header
| |
| checkAttributes | back to summary |
|---|---|
| private void checkAttributes() Check the attributes. | |
| createMapper | back to summary |
|---|---|
| public Mapper createMapper() throws BuildException Define the mapper to map source to destination files.
| |
| doGet | back to summary |
|---|---|
| public boolean doGet(final int logLevel, final Get. Deprecated only gets the first configured resource make a get request, with the supplied progress and logging info. All the other config parameters are set at the task level, source, dest, ignoreErrors, etc.
| |
| doGet | back to summary |
|---|---|
| public boolean doGet(final URL source, final File dest, final int logLevel, Get. make a get request, with the supplied progress and logging info. All the other config parameters like ignoreErrors are set at the task level.
| |
| execute | back to summary |
|---|---|
| public void execute() throws BuildException Overrides org. Does the work.
| |
| isMoved | back to summary |
|---|---|
| public static boolean isMoved(final int responseCode) Does the response code represent a redirection?
| |
| log | back to summary |
|---|---|
| public void log(final String msg, final int msgLevel) Overrides org. Doc from org. Logs a message with the given priority. This delegates the actual logging to the project. | |
| setAuthenticateOnRedirect | back to summary |
|---|---|
| public void setAuthenticateOnRedirect(final boolean v) If true, credentials are set when following a redirect to a new location.
| |
| setDest | back to summary |
|---|---|
| public void setDest(final File dest) Where to copy the source file.
| |
| setHttpUseCaches | back to summary |
|---|---|
| public void setHttpUseCaches(final boolean httpUseCache) HTTP connections only - control caching on the HttpUrlConnection: httpConnection.setUseCaches(); if false, do not allow caching on the HttpUrlConnection. Defaults to true (allow caching, which is also the HttpUrlConnection default value.
| |
| setIgnoreErrors | back to summary |
|---|---|
| public void setIgnoreErrors(final boolean v) If true, log errors but do not treat as fatal.
| |
| setMaxTime | back to summary |
|---|---|
| public void setMaxTime(final long maxTime) The time in seconds the download is allowed to take before being terminated.
| |
| setPassword | back to summary |
|---|---|
| public void setPassword(final String p) password for the basic authentication.
| |
| setQuiet | back to summary |
|---|---|
| public void setQuiet(final boolean v) If true, set default log level to Project.MSG_ERR.
| |
| setRetries | back to summary |
|---|---|
| public void setRetries(final int r) The number of attempts to make for opening the URI, defaults to 3. The name of the method is misleading as a value of 1 means "don't retry on error" and a value of 0 meant don't even try to reach the URI at all.
| |
| setSkipExisting | back to summary |
|---|---|
| public void setSkipExisting(final boolean s) Skip files that already exist locally.
| |
| setSrc | back to summary |
|---|---|
| public void setSrc(final URL u) Set an URL to get.
| |
| setTryGzipEncoding | back to summary |
|---|---|
| public void setTryGzipEncoding(boolean b) Whether to transparently try to reduce bandwidth by telling the server ant would support gzip encoding. Setting this to true also means Ant will uncompress
| |
| setUserAgent | back to summary |
|---|---|
| public void setUserAgent(final String userAgent) HTTP connections only - set the user-agent to be used when communicating with remote server. if null, then the value is considered unset and the behaviour falls back to the default of the http API.
| |
| setUsername | back to summary |
|---|---|
| public void setUsername(final String u) Username for basic auth.
| |
| setUseTimestamp | back to summary |
|---|---|
| public void setUseTimestamp(final boolean v) If true, conditionally download a file based on the timestamp of the local copy. In this situation, the if-modified-since header is set so that the file is only fetched if it is newer than the local file (or there is no local file) This flag is only valid on HTTP connections, it is ignored in other cases. When the flag is set, the local copy of the downloaded file will also have its timestamp set to the remote file time. Note that remote files of date 1/1/1970 (GMT) are treated as 'no timestamp', and web servers often serve files with a timestamp in the future by replacing their timestamp with that of the current time. Also, inter-computer clock differences can cause no end of grief.
| |
| setVerbose | back to summary |
|---|---|
| public void setVerbose(final boolean v) If true, show verbose progress information.
| |
| Access | Constructor and Description |
|---|---|
| protected |
| Base64Converter | back to summary |
|---|---|
| protected Base64Converter() | |
| Modifier and Type | Method and Description |
|---|---|
| public void | |
| public void | |
| public void |
| beginDownload | back to summary |
|---|---|
| public void beginDownload() begin a download | |
| endDownload | back to summary |
|---|---|
| public void endDownload() end a download | |
| onTick | back to summary |
|---|---|
| public void onTick() tick handler | |
| Modifier and Type | Field and Description |
|---|---|
| private URLConnection | |
| private final File | |
| private BuildException | |
| private final boolean | |
| private IOException | |
| private InputStream | |
| private final int | |
| private OutputStream | |
| private final Get. | |
| private int | |
| private final URL | |
| private boolean | |
| private final long | |
| private String |
| Access | Constructor and Description |
|---|---|
| pack-priv |
| Modifier and Type | Method and Description |
|---|---|
| pack-priv void | |
| private boolean | |
| private boolean | |
| private URLConnection | |
| private boolean | |
| public void | run()
Overrides java. Implements java. |
| private void | |
| pack-priv boolean |
| connection | back to summary |
|---|---|
| private URLConnection connection | |
| dest | back to summary |
|---|---|
| private final File dest | |
| exception | back to summary |
|---|---|
| private BuildException exception | |
| hasTimestamp | back to summary |
|---|---|
| private final boolean hasTimestamp | |
| ioexception | back to summary |
|---|---|
| private IOException ioexception | |
| is | back to summary |
|---|---|
| private InputStream is | |
| logLevel | back to summary |
|---|---|
| private final int logLevel | |
| os | back to summary |
|---|---|
| private OutputStream os | |
| progress | back to summary |
|---|---|
| private final Get. | |
| redirections | back to summary |
|---|---|
| private int redirections | |
| source | back to summary |
|---|---|
| private final URL source | |
| success | back to summary |
|---|---|
| private boolean success | |
| timestamp | back to summary |
|---|---|
| private final long timestamp | |
| userAgent | back to summary |
|---|---|
| private String userAgent | |
| GetThread | back to summary |
|---|---|
| pack-priv GetThread(final URL source, final File dest, final boolean h, final long t, final Get. | |
| closeStreams | back to summary |
|---|---|
| pack-priv void closeStreams() Closes streams, interrupts the download, may delete the output file. | |
| downloadFile | back to summary |
|---|---|
| private boolean downloadFile() throws IOException | |
| get | back to summary |
|---|---|
| private boolean get() throws IOException, BuildException | |
| openConnection | back to summary |
|---|---|
| private URLConnection openConnection(final URL aSource, final String uname, final String pword) throws IOException | |
| redirectionAllowed | back to summary |
|---|---|
| private boolean redirectionAllowed(final URL aSource, final URL aDest) | |
| run | back to summary |
|---|---|
| public void run() Overrides java. Implements java. Doc from java. This method is run by the thread when it executes. Subclasses of This method is not intended to be invoked directly. If this thread is a
platform thread created with a
| |
| updateTimeStamp | back to summary |
|---|---|
| private void updateTimeStamp() | |
| wasSuccessful | back to summary |
|---|---|
| pack-priv boolean wasSuccessful() throws IOException, BuildException Has the download completed successfully? Re-throws any exception caught during execution. | |
| Access | Constructor and Description |
|---|---|
| public |
| Modifier and Type | Method and Description |
|---|---|
| public void | beginDownload()
Implements org. |
| public void | endDownload()
Implements org. |
| public void |
| NullProgress | back to summary |
|---|---|
| public NullProgress() | |
| beginDownload | back to summary |
|---|---|
| public void beginDownload() Implements org. begin a download
| |
| endDownload | back to summary |
|---|---|
| public void endDownload() Implements org. end a download
| |
| onTick | back to summary |
|---|---|
| public void onTick() Implements org. tick handler
| |
| Modifier and Type | Field and Description |
|---|---|
| private int | |
| pack-priv PrintStream |
| Access | Constructor and Description |
|---|---|
| public |
| Modifier and Type | Method and Description |
|---|---|
| public void | beginDownload()
Implements org. |
| public void | endDownload()
Implements org. |
| public void |
| VerboseProgress | back to summary |
|---|---|
| public VerboseProgress(final PrintStream out) Construct a verbose progress reporter.
| |
| beginDownload | back to summary |
|---|---|
| public void beginDownload() Implements org. begin a download
| |
| endDownload | back to summary |
|---|---|
| public void endDownload() Implements org. end a download
| |
| onTick | back to summary |
|---|---|
| public void onTick() Implements org. tick handler
| |