public DataSource resolve()

in src/main/java/org/apache/commons/mail/resolver/DataSourceFileResolver.java [84:112]


    public DataSource resolve(final String resourceLocation, final boolean isLenient) throws IOException
    {
        File file;
        DataSource result = null;

        if (!isCid(resourceLocation))
        {
            file = new File(resourceLocation);

            if (!file.isAbsolute())
            {
                file = getBaseDir() != null ? new File(getBaseDir(), resourceLocation) : new File(resourceLocation);
            }

            if (file.exists())
            {
                result = new FileDataSource(file);
            }
            else
            {
                if (!isLenient)
                {
                    throw new IOException("Cant resolve the following file resource :" + file.getAbsolutePath());
                }
            }
        }

        return result;
    }