in commons-email2-javax/src/main/java/org/apache/commons/mail2/javax/resolver/DataSourceUrlResolver.java [100:117]
public DataSource resolve(final String resourceLocation, final boolean isLenient) throws IOException {
DataSource result = null;
try {
if (!isCid(resourceLocation)) {
result = new URLDataSource(createUrl(resourceLocation));
// validate we can read.
try (InputStream inputStream = result.getInputStream()) {
inputStream.read();
}
}
return result;
} catch (final IOException e) {
if (isLenient) {
return null;
}
throw e;
}
}