mirror of
https://github.com/ebean-orm/ebean.git
synced 2024-04-21 10:51:47 +00:00
23 lines
587 B
Java
23 lines
587 B
Java
package io.ebeaninternal.util;
|
|
|
|
import java.io.IOException;
|
|
import java.io.InputStream;
|
|
import java.net.URL;
|
|
import java.net.URLConnection;
|
|
|
|
/**
|
|
* Helper to open URL content without file descriptor caching (by underlying JDK JarURLConnection).
|
|
*/
|
|
public class UrlHelper {
|
|
|
|
/**
|
|
* Open the URL content without using caching returning the resulting InputStream.
|
|
*/
|
|
public static InputStream openNoCache(URL url) throws IOException {
|
|
|
|
URLConnection urlConnection = url.openConnection();
|
|
urlConnection.setUseCaches(false);
|
|
return urlConnection.getInputStream();
|
|
}
|
|
}
|