commons-email2-jakarta/src/main/java/org/apache/commons/mail2/jakarta/resolver/DataSourceBaseResolver.java [26:83]:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
public abstract class DataSourceBaseResolver implements DataSourceResolver {

    /** Whether to ignore resources not found or complain with an exception. */
    private final boolean lenient;

    /**
     * Constructs a new instance.
     */
    public DataSourceBaseResolver() {
        this.lenient = false;
    }

    /**
     * Constructs a new instance.
     *
     * @param lenient shall we ignore resources not found or throw an exception?
     */
    public DataSourceBaseResolver(final boolean lenient) {
        this.lenient = lenient;
    }

    /**
     * Tests whether the argument is a content id.
     *
     * @param resourceLocation the resource location to test.
     * @return true if it is a CID.
     */
    protected boolean isCid(final String resourceLocation) {
        return resourceLocation.startsWith("cid:");
    }

    /**
     * Tests whether this a file URL.
     *
     * @param urlString the URL string.
     * @return true if it is a file URL.
     */
    protected boolean isFileUrl(final String urlString) {
        return urlString.startsWith("file:/");
    }

    /**
     * Tests whether this a HTTP or HTTPS URL.
     *
     * @param urlString the URL string to test.
     * @return true if it is a HTTP or HTTPS URL.
     */
    protected boolean isHttpUrl(final String urlString) {
        return urlString.startsWith("http://") || urlString.startsWith("https://");
    }

    /**
     * Tests whether to ignore resources not found or throw an exception.
     *
     * @return the lenient flag.
     */
    public boolean isLenient() {
        return lenient;
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -



commons-email2-javax/src/main/java/org/apache/commons/mail2/javax/resolver/DataSourceBaseResolver.java [26:83]:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
public abstract class DataSourceBaseResolver implements DataSourceResolver {

    /** Whether to ignore resources not found or complain with an exception. */
    private final boolean lenient;

    /**
     * Constructs a new instance.
     */
    public DataSourceBaseResolver() {
        this.lenient = false;
    }

    /**
     * Constructs a new instance.
     *
     * @param lenient shall we ignore resources not found or throw an exception?
     */
    public DataSourceBaseResolver(final boolean lenient) {
        this.lenient = lenient;
    }

    /**
     * Tests whether the argument is a content id.
     *
     * @param resourceLocation the resource location to test.
     * @return true if it is a CID.
     */
    protected boolean isCid(final String resourceLocation) {
        return resourceLocation.startsWith("cid:");
    }

    /**
     * Tests whether this a file URL.
     *
     * @param urlString the URL string.
     * @return true if it is a file URL.
     */
    protected boolean isFileUrl(final String urlString) {
        return urlString.startsWith("file:/");
    }

    /**
     * Tests whether this a HTTP or HTTPS URL.
     *
     * @param urlString the URL string to test.
     * @return true if it is a HTTP or HTTPS URL.
     */
    protected boolean isHttpUrl(final String urlString) {
        return urlString.startsWith("http://") || urlString.startsWith("https://");
    }

    /**
     * Tests whether to ignore resources not found or throw an exception.
     *
     * @return the lenient flag.
     */
    public boolean isLenient() {
        return lenient;
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -



