Package org.apache.commons.mail
Interface DataSourceResolver
-
- All Known Implementing Classes:
DataSourceBaseResolver
,DataSourceClassPathResolver
,DataSourceCompositeResolver
,DataSourceFileResolver
,DataSourceUrlResolver
public interface DataSourceResolver
Creates aDataSource
based on an URL.- Since:
- 1.3
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description javax.activation.DataSource
resolve(java.lang.String resourceLocation)
Resolves the given resource location to aDataSource
.javax.activation.DataSource
resolve(java.lang.String resourceLocation, boolean isLenient)
Resolves the given resource location to aDataSource
.
-
-
-
Method Detail
-
resolve
javax.activation.DataSource resolve(java.lang.String resourceLocation) throws java.io.IOException
Resolves the given resource location to aDataSource
.- Parameters:
resourceLocation
- the location of the resource- Returns:
- the
DataSource
- Throws:
java.io.IOException
- the resource was not found
-
resolve
javax.activation.DataSource resolve(java.lang.String resourceLocation, boolean isLenient) throws java.io.IOException
Resolves the given resource location to aDataSource
.- Parameters:
resourceLocation
- the location of the resourceisLenient
- shall we ignore resources not found or complain with an exception?- Returns:
- the data source containing the resource or null if the resource was not found in lenient mode
- Throws:
java.io.IOException
- resolving the resource failed
-
-