Usage

Parameters

Specifies the URL of the resource to import.To import the contents of a text file, upload a file into dotCMS and specify the URL of the uploaded file.

Timeout

15000

Timeout in milliseconds.

Notes:

The timeout is specified in milliseconds (not seconds).

The timeout value is optional.

If no timeout value is specified, the default timeout (normally 15000) is used.

The default value may be changed by modifying the URL_CONNECTION_TIMEOUT property found in the dotmarketing-config.properties file.

The timeout specifies the total time to wait to both make the connection perform the read.

The Import Tool will automatically kill the connection after the specified time, regardless of what state the import is in.

Therefore the timeout should be greater than the time it takes for both the connection and read.

The $import.read() call will not follow redirects, since following redirects could potentially introduce security vulnerabilities.

Therefore you must specify the full direct path to the resource (including appropriate use of http:// vs. https://, depending on the server configuration) in the call.

Examples

Default Timeout

The following method inserts the contents of the http://www.foo.com/bleh.jsp?sneh=bar URL into the page, using the default timeout:

$import.read("http://www.foo.com/bleh.jsp?sneh=bar")

Specify Timeout and Prevent Parsing

The following imports the same URL, with a timeout ensuring that the connection will be terminated after 3 seconds, and enclosed with formatting commands to ensure the imported text is not interpreted by the Velocity parser: