Package de.juplo.httpresources
Class HttpResources
- java.lang.Object
-
- de.juplo.httpresources.HttpResources
-
public class HttpResources extends Object
- Author:
- Kai Moritz
-
-
Constructor Summary
Constructors Constructor Description HttpResources(HttpResourceFetcher fetcher, Clock clock)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static URI
convert(String url)
HttpResource
getResource(String uri)
HttpResource
getResource(URI uri)
Returns theHttpResource
, that represents the givenURI
.static boolean
isHttpResource(String resourcePath)
static URI
normalize(URI uri)
static URI
resolve(URI relative, URI uri)
-
-
-
Constructor Detail
-
HttpResources
public HttpResources(HttpResourceFetcher fetcher, Clock clock)
-
-
Method Detail
-
getResource
public HttpResource getResource(String uri)
- Parameters:
uri
- the resource location (must be a validURI
)- Returns:
- the corresponding Resource handle (never
null
)
-
getResource
public HttpResource getResource(URI uri)
Returns theHttpResource
, that represents the givenURI
.Note that a Resource handle does not imply an existing resource; you need to invoke
Resource.exists()
to check for existence.- Parameters:
uri
- the resource location, represented as anURI
- Returns:
- the corresponding Resource handle (never
null
)
-
resolve
public static URI resolve(URI relative, URI uri) throws IOException
- Throws:
IOException
-
isHttpResource
public static boolean isHttpResource(String resourcePath)
-
-