|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.apache.camel.util.ResourceHelper
public final class ResourceHelper
Helper class for loading resources on the classpath or file system.
| Method Summary | |
|---|---|
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. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Method Detail |
|---|
public static boolean hasScheme(String uri)
uri - the URI
public static String getScheme(String uri)
uri - the uri
public 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 resource
InputStream. Remember to close this stream after usage.
IOException - is thrown if the resource file could not be found or loaded as InputStream
public static URL resolveMandatoryResourceAsUrl(ClassResolver classResolver,
String uri)
throws FileNotFoundException,
MalformedURLException
classResolver - the class resolver to load the resource from the classpathuri - uri of the resource
InputStream. Remember to close this stream after usage.
FileNotFoundException - is thrown if the resource file could not be found
MalformedURLException - if the URI is malformedpublic static boolean isHttpUri(String uri)
uri - the uri
public 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 invalid
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||