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 TypeMethodDescriptionbooleanexists()Whether this resource exists.Returns anInputStreamthat reads from the underlying resource.The location of the resource.default ReaderReturns aReaderthat reads from the underlying resource using UTF-8 as charset.default ReaderThe scheme of the resource such as file, classpath, httpdefault URIgetURI()TheURIof the resource.default URLgetURL()TheURLfor the resource ornullif 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
TheURIof the resource. The default implementation creates aURIobject from resource location. -
getURL
TheURLfor the resource ornullif the URL can not be computed. The default implementation creates aURIobject from resource location.- Throws:
MalformedURLException
-
getInputStream
Returns anInputStreamthat reads from the underlying resource. Each invocation must return a newInputStreaminstance.- Throws:
IOException
-
getReader
Returns aReaderthat reads from the underlying resource using UTF-8 as charset. Each invocation must return a newReader.- Throws:
Exception- See Also:
-
getReader
Returns aReaderthat reads from the underlying resource using the givenCharsetEach invocation must return a newReader.- Throws:
Exception- See Also:
-