public static class

PDFViewCtrl.HTTPRequestOptions

extends Object
java.lang.Object
   ↳ com.pdftron.pdf.PDFViewCtrl.HTTPRequestOptions

Class Overview

Class for customizing network requests.

Summary

Public Constructors
HTTPRequestOptions()
Create a HTTPRequestOptions object.
Public Methods
void addHeader(String header, String val)
Sets a custom header to use with all requests.
void restrictDownloadUsage(boolean val)
Restrict download usage
void skipByteRangeTest(boolean skip)
By default OpenURLAsync will test the remote server's support for byte ranges using a small GET request.
void useRemoteFileSize(long sizeInByte)
By default OpenURLAsync will obtain the remote file size up front using a HEAD request.
[Expand]
Inherited Methods
From class java.lang.Object

Public Constructors

public HTTPRequestOptions ()

Create a HTTPRequestOptions object.

Public Methods

public void addHeader (String header, String val)

Sets a custom header to use with all requests.

Parameters
header A custom header.
val The value of the custom header.
Throws
PDFNetException PDFNet exception

public void restrictDownloadUsage (boolean val)

Restrict download usage

Parameters
val whether to restrict download usage
Throws
PDFNetException PDFNet exception

public void skipByteRangeTest (boolean skip)

By default OpenURLAsync will test the remote server's support for byte ranges using a small GET request. If you control the server and can guarantee it supports byte ranges you can skip this check to slightly improve the load performance.

Passing true to this function when the server does not support byte range requests will result in undefined behaviour and errors. Use at your own risk.

Parameters
skip Passing true will skip the byte range test.
Throws
PDFNetException PDFNet exception

public void useRemoteFileSize (long sizeInByte)

By default OpenURLAsync will obtain the remote file size up front using a HEAD request. Providing the file size with this function allows this request to be skipped, which will slightly improve the load performance.

Parameters
sizeInByte The size of the remote file in bytes.
Throws
PDFNetException PDFNet exception