Package org.apache.camel.spi
Interface Resource
public interface Resource
Describe a resource, such as a file or class path resource.
-
Method Summary
Modifier and TypeMethodDescriptionboolean
exists()
Whether this resource exists.Returns anInputStream
that reads from the underlying resource.The location of the resource.default Reader
Returns aReader
that reads from the underlying resource using UTF-8 as charset.default Reader
The scheme of the resource such as file, classpath, httpdefault URI
getURI()
TheURI
of the resource.default URL
getURL()
TheURL
for the resource ornull
if the URL can not be computed.
-
Method Details
-
getScheme
String getScheme()The scheme of the resource such as file, classpath, http -
getLocation
String getLocation()The location of the resource. -
exists
boolean exists()Whether this resource exists. -
getURI
TheURI
of the resource. The default implementation creates aURI
object from resource location. -
getURL
TheURL
for the resource ornull
if the URL can not be computed. The default implementation creates aURI
object from resource location.- Throws:
MalformedURLException
-
getInputStream
Returns anInputStream
that reads from the underlying resource. Each invocation must return a newInputStream
instance.- Throws:
IOException
-
getReader
Returns aReader
that reads from the underlying resource using UTF-8 as charset. Each invocation must return a newReader
.- Throws:
Exception
- See Also:
-
getReader
Returns aReader
that reads from the underlying resource using the givenCharset
Each invocation must return a newReader
.- Throws:
Exception
- See Also:
-