Lines Matching refs:URL

31 import java.net.URL;
37 * Note that even though these methods use {@link URL} parameters, they
53 * read from the given URL.
55 * @param url the URL to read from
57 * @deprecated Use {@link #asByteSource(URL)} instead. This method is
61 public static InputSupplier<InputStream> newInputStreamSupplier(URL url) {
66 * Returns a {@link ByteSource} that reads from the given URL.
70 public static ByteSource asByteSource(URL url) {
75 * A byte source that reads from a URL using {@link URL#openStream()}.
79 private final URL url;
81 private UrlByteSource(URL url) {
98 * {@link InputStreamReader} that read a URL using the given character set.
100 * @param url the URL to read from
104 * @deprecated Use {@link #asCharSource(URL, Charset)} instead. This method
109 URL url, Charset charset) {
114 * Returns a {@link CharSource} that reads from the given URL using the given
119 public static CharSource asCharSource(URL url, Charset charset) {
124 * Reads all bytes from a URL into a byte array.
126 * @param url the URL to read from
127 * @return a byte array containing all the bytes from the URL
130 public static byte[] toByteArray(URL url) throws IOException {
135 * Reads all characters from a URL into a {@link String}, using the given
138 * @param url the URL to read from
141 * @return a string containing all the characters from the URL
144 public static String toString(URL url, Charset charset) throws IOException {
149 * Streams lines from a URL, stopping when our callback returns false, or we
152 * @param url the URL to read from
159 public static <T> T readLines(URL url, Charset charset,
165 * Reads all of the lines from a URL. The lines do not include
173 * @param url the URL to read from
179 public static List<String> readLines(URL url, Charset charset)
200 * Copies all bytes from a URL to an output stream.
202 * @param from the URL to read from
206 public static void copy(URL from, OutputStream to) throws IOException {
211 * Returns a {@code URL} pointing to {@code resourceName} if the resource is
224 public static URL getResource(String resourceName) {
228 URL url = loader.getResource(resourceName);
235 * returns a {@code URL} pointing to the named resource.
239 public static URL getResource(Class<?> contextClass, String resourceName) {
240 URL url = contextClass.getResource(resourceName);