Package org.apache.commons.mail.resolver
Class DataSourceClassPathResolver
- java.lang.Object
-
- org.apache.commons.mail.resolver.DataSourceBaseResolver
-
- org.apache.commons.mail.resolver.DataSourceClassPathResolver
-
- All Implemented Interfaces:
DataSourceResolver
public class DataSourceClassPathResolver extends DataSourceBaseResolver
Creates aDataSource
based on an class path.- Since:
- 1.3
-
-
Constructor Summary
Constructors Constructor Description DataSourceClassPathResolver()
ConstructorDataSourceClassPathResolver(String classPathBase)
Constructor.DataSourceClassPathResolver(String classPathBase, boolean lenient)
Constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description String
getClassPathBase()
DataSource
resolve(String resourceLocation)
Resolves the given resource location to aDataSource
.DataSource
resolve(String resourceLocation, boolean isLenient)
Resolves the given resource location to aDataSource
.-
Methods inherited from class org.apache.commons.mail.resolver.DataSourceBaseResolver
isLenient
-
-
-
-
Constructor Detail
-
DataSourceClassPathResolver
public DataSourceClassPathResolver()
Constructor
-
DataSourceClassPathResolver
public DataSourceClassPathResolver(String classPathBase)
Constructor.- Parameters:
classPathBase
- a base class path
-
DataSourceClassPathResolver
public DataSourceClassPathResolver(String classPathBase, boolean lenient)
Constructor.- Parameters:
classPathBase
- a base class pathlenient
- shall we ignore resources not found or throw an exception?
-
-
Method Detail
-
getClassPathBase
public String getClassPathBase()
- Returns:
- the classPathBase
-
resolve
public DataSource resolve(String resourceLocation) throws IOException
Resolves the given resource location to aDataSource
.- Parameters:
resourceLocation
- the location of the resource- Returns:
- the
DataSource
- Throws:
IOException
- the resource was not found
-
resolve
public DataSource resolve(String resourceLocation, boolean isLenient) throws 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:
IOException
- resolving the resource failed
-
-