Class URLReader
- java.lang.Object
-
- java.io.Reader
-
- jdk.nashorn.api.scripting.URLReader
- All Implemented Interfaces:
-
Closeable
,AutoCloseable
,Readable
@Deprecated(since="11", forRemoval=true) 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
Fields
Fields declared in class java.io.Reader
lock
Constructors
Constructor | Description |
---|---|
URLReader(URL url) | Deprecated, for removal: This API element is subject to removal in a future version. Constructor |
URLReader(URL url,
String charsetName) | Deprecated, for removal: This API element is subject to removal in a future version. Constructor |
URLReader(URL url,
Charset cs) | Deprecated, for removal: This API element is subject to removal in a future version. Constructor |
Methods
Modifier and Type | Method | Description |
---|---|---|
Charset | getCharset() | Deprecated, for removal: This API element is subject to removal in a future version. Charset used by this reader |
URL | getURL() | Deprecated, for removal: This API element is subject to removal in a future version. URL of this reader |
Methods declared in class java.io.Reader
close, mark, markSupported, nullReader, read, read, read, read, ready, reset, skip, transferTo
Methods declared in class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Constructors
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 URLReader -
charsetName
- 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 URLReader -
cs
- Charset used to convert bytes to chars - Throws:
-
NullPointerException
- if url is null
Methods
getURL
public URL getURL()
URL of this reader
- Returns:
- the URL from which this reader reads.
getCharset
public Charset getCharset()
Charset used by this reader
- Returns:
- the Charset used to convert bytes to chars
© 1993, 2020, Oracle and/or its affiliates. All rights reserved.
Documentation extracted from Debian's OpenJDK Development Kit package.
Licensed under the GNU General Public License, version 2, with the Classpath Exception.
Various third party code in OpenJDK is licensed under different licenses (see Debian package).
Java and OpenJDK are trademarks or registered trademarks of Oracle and/or its affiliates.
https://docs.oracle.com/en/java/javase/11/docs/api/jdk.scripting.nashorn/jdk/nashorn/api/scripting/URLReader.html