Foxit PDF RDK

Public Member Functions | List of all members
UrlFileRead Class Reference
Inheritance diagram for UrlFileRead:

## Public Member Functions
| constructor (urlHeader, cacheDir, cacheOption, requestOptions< string, string >, isReadFromCache)
Public Member Functions inherited from ReaderCallback
| GetSize ()
| Get total size of the file. More...
| ReadBlock (buffer, offset, size)
| Read a data block from the file. More...
| ReadBlock (offset, size)
| Read a data block from the file. More...
| Release ()
| Called when to release everything. More...
Public Member Functions inherited from NativeObjectWrapper
| constructor (r)
| GetPointerAsNumber ()

## Detailed Description

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.

## Member Function Documentation

## ◆ 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.