Class HTTPFileRetriever
java.lang.Object
org.graylog2.lookup.adapters.dsvhttp.HTTPFileRetriever
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionboolean
downloadFile
(String url, Path toPath) Request that a file be downloaded and stored to the provided location.boolean
downloadFileIfNotModified
(String url, Path toPath) Request that a file be downloaded and stored to the provided location.Request file.Optional<byte[]>
fetchFileBytes
(String url) Request file bytes.Optional<byte[]>
Request file bytes by sending an "If-Modified-Since" header so that the file won't be fetched if it hasn't been modified since the last request.Request file by sending an "If-Modified-Since" header so that the file won't be fetched if it hasn't been modified since the last request.
-
Constructor Details
-
HTTPFileRetriever
@Inject public HTTPFileRetriever(okhttp3.OkHttpClient httpClient)
-
-
Method Details
-
fetchFile
Request file. No "If-Modified-Since" header will be sent so the file will be fetched again, even if hasn't been modified since the last fetch.- Throws:
IOException
-
fetchFileBytes
Request file bytes. No "If-Modified-Since" header will be sent so the file will be fetched again, even if hasn't been modified since the last fetch.- Throws:
IOException
-
downloadFile
Request that a file be downloaded and stored to the provided location. No "If-Modified-Since" header will be sent so the file will be fetched again, even if it hasn't been modified since the last fetch.- Throws:
IOException
-
fetchFileIfNotModified
Request file by sending an "If-Modified-Since" header so that the file won't be fetched if it hasn't been modified since the last request.- Throws:
IOException
-
fetchFileBytesIfNotModified
Request file bytes by sending an "If-Modified-Since" header so that the file won't be fetched if it hasn't been modified since the last request.- Throws:
IOException
-
downloadFileIfNotModified
Request that a file be downloaded and stored to the provided location. Will send the "If-Modified-Since" header so that the file won't be fetched if it hasn't been modified since the last request. Returns TRUE if the file was downloaded, FALSE otherwise.- Throws:
IOException
-