public final class ResourceHelper extends Object
| Modifier and Type | Method and Description |
|---|---|
static String |
appendParameters(String uri,
Map<String,Object> parameters)
Appends the parameters to the given uri
|
static String |
getScheme(String uri)
Gets the scheme from the URI (e.g.
|
static boolean |
hasScheme(String uri)
Determines whether the URI has a scheme (e.g.
|
static boolean |
isHttpUri(String uri)
Is the given uri a http uri?
|
static InputStream |
resolveMandatoryResourceAsInputStream(ClassResolver classResolver,
String uri)
Resolves the mandatory resource.
|
static URL |
resolveMandatoryResourceAsUrl(ClassResolver classResolver,
String uri)
Resolves the mandatory resource.
|
static InputStream |
resolveResourceAsInputStream(ClassResolver classResolver,
String uri)
Resolves the resource.
|
static URL |
resolveResourceAsUrl(ClassResolver classResolver,
String uri)
Resolves the resource.
|
public static boolean hasScheme(String uri)
uri - the URIpublic static String getScheme(String uri)
uri - the uripublic static InputStream resolveMandatoryResourceAsInputStream(ClassResolver classResolver, String uri) throws IOException
resolveMandatoryResourceAsUrl(org.apache.camel.spi.ClassResolver, String)classResolver - the class resolver to load the resource from the classpathuri - URI of the resourceInputStream. Remember to close this stream after usage.IOException - is thrown if the resource file could not be found or loaded as InputStreampublic static InputStream resolveResourceAsInputStream(ClassResolver classResolver, String uri) throws IOException
resolveMandatoryResourceAsUrl(org.apache.camel.spi.ClassResolver, String)classResolver - the class resolver to load the resource from the classpathuri - URI of the resourceInputStream. Remember to close this stream after usage. Or null if not found.IOException - is thrown if error loading the resourcepublic static URL resolveMandatoryResourceAsUrl(ClassResolver classResolver, String uri) throws FileNotFoundException, MalformedURLException
classResolver - the class resolver to load the resource from the classpathuri - uri of the resourceURL.FileNotFoundException - is thrown if the resource file could not be foundMalformedURLException - if the URI is malformedpublic static URL resolveResourceAsUrl(ClassResolver classResolver, String uri) throws MalformedURLException
classResolver - the class resolver to load the resource from the classpathuri - uri of the resourceURL. Or null if not found.MalformedURLException - if the URI is malformedpublic static boolean isHttpUri(String uri)
uri - the uripublic static String appendParameters(String uri, Map<String,Object> parameters) throws URISyntaxException
uri - the uriparameters - the additional parameters (will clear the map)URISyntaxException - is thrown if the uri is invalidApache Camel