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 java.io.Reader
mark, markSupported, nullReader, read, read, read, 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:
read
in classReader
- Throws:
IOException
-
close
- Specified by:
close
in interfaceAutoCloseable
- Specified by:
close
in interfaceCloseable
- Specified by:
close
in classReader
- Throws:
IOException
-
getURL
URL of this reader- Returns:
- the URL from which this reader reads.
-
getCharset
Charset used by this reader- Returns:
- the Charset used to convert bytes to chars
-