The UrlFileRead class is designed to handle file reading from a specified URL with enhanced features such as local caching and custom HTTP request options. This class extends ReaderCallback, integrating callback functionality to manage asynchronous file reading operations effectively.
- Examples
- /Users/ec2-user/gitlab-runner/builds/E-xKdhDo/0/foxit/sdk/mobile/gsdk-doc-auto-build/harmony_nodejs/input/Index.js.
◆ constructor()
| UrlFileRead.constructor |
( |
urlHeader |
, |
|
|
cacheDir |
, |
|
|
cacheOption |
, |
|
|
requestOptions< string, string > |
, |
|
|
isReadFromCache |
|
|
) |
| |
Creates an instance of UrlFileRead to manage file reading from a URL, with options for caching and request customization.
- Parameters
-
| {string} | urlHeader - The URL header information; |
| {string} | cacheDir - The directory path where the file should be cached. If null, caching might be skipped or handled differently. |
| {CacheOption} | [cacheOption] - Optional configuration for how caching should be performed. This can include details like expiration of cache, maximum size, etc. |
| {Map<string,string>} | [requestOptions] - Optional headers or other request options that should be applied when fetching the file from the URL. |
| {boolean} | [isReadFromCache] - Optional flag indicating whether to read the file directly from cache if available, bypassing a network request. |