r01f.resources
Class URLResourcesLoader
java.lang.Object
r01f.resources.ResourcesLoaderBase
r01f.resources.URLResourcesLoader
- All Implemented Interfaces:
- ResourcesLoader
public class URLResourcesLoader
- extends ResourcesLoaderBase
Clase que carga un fichero desde una URL, vía Http.
|
Method Summary |
private java.net.HttpURLConnection |
_getURLConnection(java.lang.String url,
java.nio.charset.Charset charset)
Devuelve un InputStream al response. |
java.io.InputStream |
getInputStream(java.lang.String resourcePath,
boolean reload)
Obtiene un InputStream a un recurso (fichero). |
java.io.Reader |
getReader(java.lang.String resourcePath,
boolean reload)
Obtiene un Reader a un recurso (fichero). |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
serverCharsetName
private java.lang.String serverCharsetName
proxyHost
private java.lang.String proxyHost
proxyPort
private java.lang.String proxyPort
proxyUser
private java.lang.String proxyUser
proxyPassword
private java.lang.String proxyPassword
URLResourcesLoader
URLResourcesLoader(ResourcesLoaderDef def)
getInputStream
public java.io.InputStream getInputStream(java.lang.String resourcePath,
boolean reload)
throws java.io.IOException
- Description copied from interface:
ResourcesLoader
- Obtiene un InputStream a un recurso (fichero).
- Parameters:
resourcePath - Path hasta el recurso.reload - Será true si hay que recargar el recurso no cogiendo datos de caché si esta existe.
- Returns:
- El InputStream al recurso.
- Throws:
java.io.IOException - Si no se puede acceder al recurso.
getReader
public java.io.Reader getReader(java.lang.String resourcePath,
boolean reload)
throws java.io.IOException
- Description copied from interface:
ResourcesLoader
- Obtiene un Reader a un recurso (fichero).
- Parameters:
resourcePath - Path hasta el fichero.reload - Será true si hay que recargar el recurso no cogiendo datos de caché si esta existe.
- Returns:
- El Reader al recurso.
- Throws:
java.io.IOException - Si no se puede acceder al recurso.
_getURLConnection
private java.net.HttpURLConnection _getURLConnection(java.lang.String url,
java.nio.charset.Charset charset)
throws java.io.IOException
- Devuelve un InputStream al response.
- Parameters:
url - La url a llamar.charset - El charset del servidor .
- Returns:
- El inputStream.
- Throws:
java.io.IOException - Si se produce un error al hacer la llamada.