Class URLReader
java.lang.Object
java.io.Reader
org.openjdk.nashorn.api.scripting.URLReader
- All Implemented Interfaces:
Closeable, AutoCloseable, Readable
A Reader that reads from a URL. Used to make sure that the reader
reads content from given URL and can be trusted to do so.
- Since:
- 1.8u40
-
Field Summary
-
Constructor Summary
Constructors -
Method Summary
Methods inherited from class Reader
mark, markSupported, nullReader, of, read, read, read, readAllAsString, readAllLines, ready, reset, skip, transferTo
-
Constructor Details
-
URLReader
Constructor- Parameters:
url- URL for this URLReader- Throws:
NullPointerException- if url is null
-
URLReader
Constructor- Parameters:
url- URL for this URLReadercharsetName- Name of the Charset used to convert bytes to chars- Throws:
NullPointerException- if url is null
-
URLReader
Constructor- Parameters:
url- URL for this URLReadercs- Charset used to convert bytes to chars- Throws:
NullPointerException- if url is null
-
-
Method Details
-
read
- Specified by:
readin classReader- Throws:
IOException
-
close
- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceCloseable- Specified by:
closein classReader- Throws:
IOException
-
getURL
-
getCharset
Charset used by this reader- Returns:
- the Charset used to convert bytes to chars
-