- java.lang.Object
-
- java.io.Reader
-
- jdk.nashorn.api.scripting.URLReader
-
- All Implemented Interfaces:
Closeable
,AutoCloseable
,Readable
public final class URLReader extends Reader
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
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Charset
getCharset()
Charset used by this readerURL
getURL()
URL of this reader-
Methods declared in class java.io.Reader
close, mark, markSupported, nullReader, read, read, read, read, ready, reset, skip, transferTo
-
-
-
-
Constructor Detail
-
URLReader
public URLReader(URL url)
Constructor- Parameters:
url
- URL for this URLReader- Throws:
NullPointerException
- if url is null
-
URLReader
public URLReader(URL url, String charsetName)
Constructor- Parameters:
url
- URL for this URLReadercharsetName
- Name of the Charset used to convert bytes to chars- Throws:
NullPointerException
- if url is null
-
URLReader
public URLReader(URL url, Charset cs)
Constructor- Parameters:
url
- URL for this URLReadercs
- Charset used to convert bytes to chars- Throws:
NullPointerException
- if url is null
-
-