commons-notifications mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From t.@apache.org
Subject svn commit: r952467 [21/22] - in /websites/production/commons/content/proper/commons-email/javadocs/api-release: ./ org/ org/apache/ org/apache/commons/ org/apache/commons/mail/ org/apache/commons/mail/class-use/ org/apache/commons/mail/resolver/ org/a...
Date Sat, 23 May 2015 18:45:38 GMT
Propchange: websites/production/commons/content/proper/commons-email/javadocs/api-release/src-html/org/apache/commons/mail/resolver/DataSourceBaseResolver.html
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: websites/production/commons/content/proper/commons-email/javadocs/api-release/src-html/org/apache/commons/mail/resolver/DataSourceBaseResolver.html
------------------------------------------------------------------------------
    svn:keywords = Id Revision HeadURL

Propchange: websites/production/commons/content/proper/commons-email/javadocs/api-release/src-html/org/apache/commons/mail/resolver/DataSourceBaseResolver.html
------------------------------------------------------------------------------
    svn:mime-type = text/html

Added: websites/production/commons/content/proper/commons-email/javadocs/api-release/src-html/org/apache/commons/mail/resolver/DataSourceClassPathResolver.html
==============================================================================
--- websites/production/commons/content/proper/commons-email/javadocs/api-release/src-html/org/apache/commons/mail/resolver/DataSourceClassPathResolver.html (added)
+++ websites/production/commons/content/proper/commons-email/javadocs/api-release/src-html/org/apache/commons/mail/resolver/DataSourceClassPathResolver.html Sat May 23 18:45:36 2015
@@ -0,0 +1,208 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
+<html lang="en">
+<head>
+<title>Source code</title>
+<link rel="stylesheet" type="text/css" href="../../../../../../stylesheet.css" title="Style">
+</head>
+<body>
+<div class="sourceContainer">
+<pre><span class="sourceLineNo">001</span>/*<a name="line.1"></a>
+<span class="sourceLineNo">002</span> * Licensed to the Apache Software Foundation (ASF) under one or more<a name="line.2"></a>
+<span class="sourceLineNo">003</span> * contributor license agreements.  See the NOTICE file distributed with<a name="line.3"></a>
+<span class="sourceLineNo">004</span> * this work for additional information regarding copyright ownership.<a name="line.4"></a>
+<span class="sourceLineNo">005</span> * The ASF licenses this file to You under the Apache License, Version 2.0<a name="line.5"></a>
+<span class="sourceLineNo">006</span> * (the "License"); you may not use this file except in compliance with<a name="line.6"></a>
+<span class="sourceLineNo">007</span> * the License.  You may obtain a copy of the License at<a name="line.7"></a>
+<span class="sourceLineNo">008</span> *<a name="line.8"></a>
+<span class="sourceLineNo">009</span> *     http://www.apache.org/licenses/LICENSE-2.0<a name="line.9"></a>
+<span class="sourceLineNo">010</span> *<a name="line.10"></a>
+<span class="sourceLineNo">011</span> * Unless required by applicable law or agreed to in writing, software<a name="line.11"></a>
+<span class="sourceLineNo">012</span> * distributed under the License is distributed on an "AS IS" BASIS,<a name="line.12"></a>
+<span class="sourceLineNo">013</span> * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.<a name="line.13"></a>
+<span class="sourceLineNo">014</span> * See the License for the specific language governing permissions and<a name="line.14"></a>
+<span class="sourceLineNo">015</span> * limitations under the License.<a name="line.15"></a>
+<span class="sourceLineNo">016</span> */<a name="line.16"></a>
+<span class="sourceLineNo">017</span>package org.apache.commons.mail.resolver;<a name="line.17"></a>
+<span class="sourceLineNo">018</span><a name="line.18"></a>
+<span class="sourceLineNo">019</span>import javax.activation.DataSource;<a name="line.19"></a>
+<span class="sourceLineNo">020</span>import javax.activation.FileTypeMap;<a name="line.20"></a>
+<span class="sourceLineNo">021</span>import javax.mail.util.ByteArrayDataSource;<a name="line.21"></a>
+<span class="sourceLineNo">022</span><a name="line.22"></a>
+<span class="sourceLineNo">023</span>import java.io.IOException;<a name="line.23"></a>
+<span class="sourceLineNo">024</span>import java.io.InputStream;<a name="line.24"></a>
+<span class="sourceLineNo">025</span><a name="line.25"></a>
+<span class="sourceLineNo">026</span>/**<a name="line.26"></a>
+<span class="sourceLineNo">027</span> * Creates a &lt;code&gt;DataSource&lt;/code&gt; based on an class path.<a name="line.27"></a>
+<span class="sourceLineNo">028</span> *<a name="line.28"></a>
+<span class="sourceLineNo">029</span> * @since 1.3<a name="line.29"></a>
+<span class="sourceLineNo">030</span> * @version $Id$<a name="line.30"></a>
+<span class="sourceLineNo">031</span> */<a name="line.31"></a>
+<span class="sourceLineNo">032</span>public class DataSourceClassPathResolver extends DataSourceBaseResolver<a name="line.32"></a>
+<span class="sourceLineNo">033</span>{<a name="line.33"></a>
+<span class="sourceLineNo">034</span>    /** the base string of the resource relative to the classpath when resolving relative paths */<a name="line.34"></a>
+<span class="sourceLineNo">035</span>    private final String classPathBase;<a name="line.35"></a>
+<span class="sourceLineNo">036</span><a name="line.36"></a>
+<span class="sourceLineNo">037</span>    /**<a name="line.37"></a>
+<span class="sourceLineNo">038</span>     * Constructor<a name="line.38"></a>
+<span class="sourceLineNo">039</span>     */<a name="line.39"></a>
+<span class="sourceLineNo">040</span>    public DataSourceClassPathResolver()<a name="line.40"></a>
+<span class="sourceLineNo">041</span>    {<a name="line.41"></a>
+<span class="sourceLineNo">042</span>        this.classPathBase = "/";<a name="line.42"></a>
+<span class="sourceLineNo">043</span>    }<a name="line.43"></a>
+<span class="sourceLineNo">044</span><a name="line.44"></a>
+<span class="sourceLineNo">045</span>    /**<a name="line.45"></a>
+<span class="sourceLineNo">046</span>     * Constructor.<a name="line.46"></a>
+<span class="sourceLineNo">047</span>     *<a name="line.47"></a>
+<span class="sourceLineNo">048</span>     * @param classPathBase a base class path<a name="line.48"></a>
+<span class="sourceLineNo">049</span>     */<a name="line.49"></a>
+<span class="sourceLineNo">050</span>    public DataSourceClassPathResolver(final String classPathBase)<a name="line.50"></a>
+<span class="sourceLineNo">051</span>    {<a name="line.51"></a>
+<span class="sourceLineNo">052</span>        this.classPathBase = classPathBase.endsWith("/") ? classPathBase : classPathBase + "/";<a name="line.52"></a>
+<span class="sourceLineNo">053</span>    }<a name="line.53"></a>
+<span class="sourceLineNo">054</span><a name="line.54"></a>
+<span class="sourceLineNo">055</span>    /**<a name="line.55"></a>
+<span class="sourceLineNo">056</span>     * Constructor.<a name="line.56"></a>
+<span class="sourceLineNo">057</span>     *<a name="line.57"></a>
+<span class="sourceLineNo">058</span>     * @param classPathBase a base class path<a name="line.58"></a>
+<span class="sourceLineNo">059</span>     * @param lenient shall we ignore resources not found or throw an exception?<a name="line.59"></a>
+<span class="sourceLineNo">060</span>     */<a name="line.60"></a>
+<span class="sourceLineNo">061</span>    public DataSourceClassPathResolver(final String classPathBase, final boolean lenient)<a name="line.61"></a>
+<span class="sourceLineNo">062</span>    {<a name="line.62"></a>
+<span class="sourceLineNo">063</span>        super(lenient);<a name="line.63"></a>
+<span class="sourceLineNo">064</span>        this.classPathBase = classPathBase.endsWith("/") ? classPathBase : classPathBase + "/";<a name="line.64"></a>
+<span class="sourceLineNo">065</span>    }<a name="line.65"></a>
+<span class="sourceLineNo">066</span><a name="line.66"></a>
+<span class="sourceLineNo">067</span>    /**<a name="line.67"></a>
+<span class="sourceLineNo">068</span>     * @return the classPathBase<a name="line.68"></a>
+<span class="sourceLineNo">069</span>     */<a name="line.69"></a>
+<span class="sourceLineNo">070</span>    public String getClassPathBase()<a name="line.70"></a>
+<span class="sourceLineNo">071</span>    {<a name="line.71"></a>
+<span class="sourceLineNo">072</span>        return classPathBase;<a name="line.72"></a>
+<span class="sourceLineNo">073</span>    }<a name="line.73"></a>
+<span class="sourceLineNo">074</span><a name="line.74"></a>
+<span class="sourceLineNo">075</span>    /** {@inheritDoc} */<a name="line.75"></a>
+<span class="sourceLineNo">076</span>    public DataSource resolve(final String resourceLocation) throws IOException<a name="line.76"></a>
+<span class="sourceLineNo">077</span>    {<a name="line.77"></a>
+<span class="sourceLineNo">078</span>        return resolve(resourceLocation, isLenient());<a name="line.78"></a>
+<span class="sourceLineNo">079</span>    }<a name="line.79"></a>
+<span class="sourceLineNo">080</span><a name="line.80"></a>
+<span class="sourceLineNo">081</span>    /** {@inheritDoc} */<a name="line.81"></a>
+<span class="sourceLineNo">082</span>    public DataSource resolve(final String resourceLocation, final boolean isLenient) throws IOException<a name="line.82"></a>
+<span class="sourceLineNo">083</span>    {<a name="line.83"></a>
+<span class="sourceLineNo">084</span>        DataSource result = null;<a name="line.84"></a>
+<span class="sourceLineNo">085</span><a name="line.85"></a>
+<span class="sourceLineNo">086</span>        try<a name="line.86"></a>
+<span class="sourceLineNo">087</span>        {<a name="line.87"></a>
+<span class="sourceLineNo">088</span>            if (!isCid(resourceLocation) &amp;&amp; !isHttpUrl(resourceLocation))<a name="line.88"></a>
+<span class="sourceLineNo">089</span>            {<a name="line.89"></a>
+<span class="sourceLineNo">090</span>                final String mimeType = FileTypeMap.getDefaultFileTypeMap().getContentType(resourceLocation);<a name="line.90"></a>
+<span class="sourceLineNo">091</span>                final String resourceName = getResourceName(resourceLocation);<a name="line.91"></a>
+<span class="sourceLineNo">092</span>                final InputStream is = DataSourceClassPathResolver.class.getResourceAsStream(resourceName);<a name="line.92"></a>
+<span class="sourceLineNo">093</span><a name="line.93"></a>
+<span class="sourceLineNo">094</span>                if (is != null)<a name="line.94"></a>
+<span class="sourceLineNo">095</span>                {<a name="line.95"></a>
+<span class="sourceLineNo">096</span>                    final ByteArrayDataSource ds = new ByteArrayDataSource(is, mimeType);<a name="line.96"></a>
+<span class="sourceLineNo">097</span>                    // EMAIL-125: set the name of the DataSource to the normalized resource URL<a name="line.97"></a>
+<span class="sourceLineNo">098</span>                    // similar to other DataSource implementations, e.g. FileDataSource, URLDataSource<a name="line.98"></a>
+<span class="sourceLineNo">099</span>                    ds.setName(DataSourceClassPathResolver.class.getResource(resourceName).toString());<a name="line.99"></a>
+<span class="sourceLineNo">100</span>                    result = ds;<a name="line.100"></a>
+<span class="sourceLineNo">101</span>                }<a name="line.101"></a>
+<span class="sourceLineNo">102</span>                else<a name="line.102"></a>
+<span class="sourceLineNo">103</span>                {<a name="line.103"></a>
+<span class="sourceLineNo">104</span>                    if (isLenient)<a name="line.104"></a>
+<span class="sourceLineNo">105</span>                    {<a name="line.105"></a>
+<span class="sourceLineNo">106</span>                        return null;<a name="line.106"></a>
+<span class="sourceLineNo">107</span>                    }<a name="line.107"></a>
+<span class="sourceLineNo">108</span>                    throw new IOException("The following class path resource was not found : " + resourceLocation);<a name="line.108"></a>
+<span class="sourceLineNo">109</span>                }<a name="line.109"></a>
+<span class="sourceLineNo">110</span>            }<a name="line.110"></a>
+<span class="sourceLineNo">111</span><a name="line.111"></a>
+<span class="sourceLineNo">112</span><a name="line.112"></a>
+<span class="sourceLineNo">113</span>            return result;<a name="line.113"></a>
+<span class="sourceLineNo">114</span>        }<a name="line.114"></a>
+<span class="sourceLineNo">115</span>        catch (final IOException e)<a name="line.115"></a>
+<span class="sourceLineNo">116</span>        {<a name="line.116"></a>
+<span class="sourceLineNo">117</span>            if (isLenient)<a name="line.117"></a>
+<span class="sourceLineNo">118</span>            {<a name="line.118"></a>
+<span class="sourceLineNo">119</span>                return null;<a name="line.119"></a>
+<span class="sourceLineNo">120</span>            }<a name="line.120"></a>
+<span class="sourceLineNo">121</span>            throw e;<a name="line.121"></a>
+<span class="sourceLineNo">122</span>        }<a name="line.122"></a>
+<span class="sourceLineNo">123</span>    }<a name="line.123"></a>
+<span class="sourceLineNo">124</span><a name="line.124"></a>
+<span class="sourceLineNo">125</span>    /**<a name="line.125"></a>
+<span class="sourceLineNo">126</span>     * Returns the resource name for a given resource location.<a name="line.126"></a>
+<span class="sourceLineNo">127</span>     *<a name="line.127"></a>
+<span class="sourceLineNo">128</span>     * @param resourceLocation the resource location<a name="line.128"></a>
+<span class="sourceLineNo">129</span>     * @return {@link #getClassPathBase()} + {@code resourceLocation}<a name="line.129"></a>
+<span class="sourceLineNo">130</span>     * @see #getClassPathBase()<a name="line.130"></a>
+<span class="sourceLineNo">131</span>     */<a name="line.131"></a>
+<span class="sourceLineNo">132</span>    private String getResourceName(final String resourceLocation)<a name="line.132"></a>
+<span class="sourceLineNo">133</span>    {<a name="line.133"></a>
+<span class="sourceLineNo">134</span>        return (getClassPathBase() + resourceLocation).replaceAll("//", "/");<a name="line.134"></a>
+<span class="sourceLineNo">135</span>    }<a name="line.135"></a>
+<span class="sourceLineNo">136</span>}<a name="line.136"></a>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+</pre>
+</div>
+</body>
+</html>

Propchange: websites/production/commons/content/proper/commons-email/javadocs/api-release/src-html/org/apache/commons/mail/resolver/DataSourceClassPathResolver.html
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: websites/production/commons/content/proper/commons-email/javadocs/api-release/src-html/org/apache/commons/mail/resolver/DataSourceClassPathResolver.html
------------------------------------------------------------------------------
    svn:keywords = Id Revision HeadURL

Propchange: websites/production/commons/content/proper/commons-email/javadocs/api-release/src-html/org/apache/commons/mail/resolver/DataSourceClassPathResolver.html
------------------------------------------------------------------------------
    svn:mime-type = text/html

Added: websites/production/commons/content/proper/commons-email/javadocs/api-release/src-html/org/apache/commons/mail/resolver/DataSourceCompositeResolver.html
==============================================================================
--- websites/production/commons/content/proper/commons-email/javadocs/api-release/src-html/org/apache/commons/mail/resolver/DataSourceCompositeResolver.html (added)
+++ websites/production/commons/content/proper/commons-email/javadocs/api-release/src-html/org/apache/commons/mail/resolver/DataSourceCompositeResolver.html Sat May 23 18:45:36 2015
@@ -0,0 +1,178 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
+<html lang="en">
+<head>
+<title>Source code</title>
+<link rel="stylesheet" type="text/css" href="../../../../../../stylesheet.css" title="Style">
+</head>
+<body>
+<div class="sourceContainer">
+<pre><span class="sourceLineNo">001</span>/*<a name="line.1"></a>
+<span class="sourceLineNo">002</span> * Licensed to the Apache Software Foundation (ASF) under one or more<a name="line.2"></a>
+<span class="sourceLineNo">003</span> * contributor license agreements.  See the NOTICE file distributed with<a name="line.3"></a>
+<span class="sourceLineNo">004</span> * this work for additional information regarding copyright ownership.<a name="line.4"></a>
+<span class="sourceLineNo">005</span> * The ASF licenses this file to You under the Apache License, Version 2.0<a name="line.5"></a>
+<span class="sourceLineNo">006</span> * (the "License"); you may not use this file except in compliance with<a name="line.6"></a>
+<span class="sourceLineNo">007</span> * the License.  You may obtain a copy of the License at<a name="line.7"></a>
+<span class="sourceLineNo">008</span> *<a name="line.8"></a>
+<span class="sourceLineNo">009</span> *     http://www.apache.org/licenses/LICENSE-2.0<a name="line.9"></a>
+<span class="sourceLineNo">010</span> *<a name="line.10"></a>
+<span class="sourceLineNo">011</span> * Unless required by applicable law or agreed to in writing, software<a name="line.11"></a>
+<span class="sourceLineNo">012</span> * distributed under the License is distributed on an "AS IS" BASIS,<a name="line.12"></a>
+<span class="sourceLineNo">013</span> * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.<a name="line.13"></a>
+<span class="sourceLineNo">014</span> * See the License for the specific language governing permissions and<a name="line.14"></a>
+<span class="sourceLineNo">015</span> * limitations under the License.<a name="line.15"></a>
+<span class="sourceLineNo">016</span> */<a name="line.16"></a>
+<span class="sourceLineNo">017</span>package org.apache.commons.mail.resolver;<a name="line.17"></a>
+<span class="sourceLineNo">018</span><a name="line.18"></a>
+<span class="sourceLineNo">019</span>import org.apache.commons.mail.DataSourceResolver;<a name="line.19"></a>
+<span class="sourceLineNo">020</span><a name="line.20"></a>
+<span class="sourceLineNo">021</span>import javax.activation.DataSource;<a name="line.21"></a>
+<span class="sourceLineNo">022</span>import java.io.IOException;<a name="line.22"></a>
+<span class="sourceLineNo">023</span><a name="line.23"></a>
+<span class="sourceLineNo">024</span>/**<a name="line.24"></a>
+<span class="sourceLineNo">025</span> * A composite data source resolver. It allows to resolve data sources coming from<a name="line.25"></a>
+<span class="sourceLineNo">026</span> * multiple locations such as the classpath, the file system or an URL.<a name="line.26"></a>
+<span class="sourceLineNo">027</span> *<a name="line.27"></a>
+<span class="sourceLineNo">028</span> * @since 1.3<a name="line.28"></a>
+<span class="sourceLineNo">029</span> * @version $Id$<a name="line.29"></a>
+<span class="sourceLineNo">030</span> */<a name="line.30"></a>
+<span class="sourceLineNo">031</span>public class DataSourceCompositeResolver extends DataSourceBaseResolver<a name="line.31"></a>
+<span class="sourceLineNo">032</span>{<a name="line.32"></a>
+<span class="sourceLineNo">033</span>    /** the list of resolvers */<a name="line.33"></a>
+<span class="sourceLineNo">034</span>    private final DataSourceResolver[] dataSourceResolvers;<a name="line.34"></a>
+<span class="sourceLineNo">035</span><a name="line.35"></a>
+<span class="sourceLineNo">036</span>    /**<a name="line.36"></a>
+<span class="sourceLineNo">037</span>     * Constructor.<a name="line.37"></a>
+<span class="sourceLineNo">038</span>     *<a name="line.38"></a>
+<span class="sourceLineNo">039</span>     * @param dataSourceResolvers a list of of resolvers being used<a name="line.39"></a>
+<span class="sourceLineNo">040</span>     */<a name="line.40"></a>
+<span class="sourceLineNo">041</span>    public DataSourceCompositeResolver(final DataSourceResolver[] dataSourceResolvers)<a name="line.41"></a>
+<span class="sourceLineNo">042</span>    {<a name="line.42"></a>
+<span class="sourceLineNo">043</span>        this.dataSourceResolvers = new DataSourceResolver[dataSourceResolvers.length];<a name="line.43"></a>
+<span class="sourceLineNo">044</span>        System.arraycopy(dataSourceResolvers, 0, this.dataSourceResolvers, 0, dataSourceResolvers.length);<a name="line.44"></a>
+<span class="sourceLineNo">045</span>    }<a name="line.45"></a>
+<span class="sourceLineNo">046</span><a name="line.46"></a>
+<span class="sourceLineNo">047</span>    /**<a name="line.47"></a>
+<span class="sourceLineNo">048</span>     * Constructor.<a name="line.48"></a>
+<span class="sourceLineNo">049</span>     *<a name="line.49"></a>
+<span class="sourceLineNo">050</span>     * @param dataSourceResolvers a list of of resolvers being used<a name="line.50"></a>
+<span class="sourceLineNo">051</span>     * @param isLenient shall we ignore resources not found or throw an exception?<a name="line.51"></a>
+<span class="sourceLineNo">052</span>     */<a name="line.52"></a>
+<span class="sourceLineNo">053</span>    public DataSourceCompositeResolver(final DataSourceResolver[] dataSourceResolvers, final boolean isLenient)<a name="line.53"></a>
+<span class="sourceLineNo">054</span>    {<a name="line.54"></a>
+<span class="sourceLineNo">055</span>        super(isLenient);<a name="line.55"></a>
+<span class="sourceLineNo">056</span>        this.dataSourceResolvers = new DataSourceResolver[dataSourceResolvers.length];<a name="line.56"></a>
+<span class="sourceLineNo">057</span>        System.arraycopy(dataSourceResolvers, 0, this.dataSourceResolvers, 0, dataSourceResolvers.length);<a name="line.57"></a>
+<span class="sourceLineNo">058</span>    }<a name="line.58"></a>
+<span class="sourceLineNo">059</span><a name="line.59"></a>
+<span class="sourceLineNo">060</span>    /**<a name="line.60"></a>
+<span class="sourceLineNo">061</span>     * Get the underlying data source resolvers.<a name="line.61"></a>
+<span class="sourceLineNo">062</span>     *<a name="line.62"></a>
+<span class="sourceLineNo">063</span>     * @return underlying data source resolvers<a name="line.63"></a>
+<span class="sourceLineNo">064</span>     */<a name="line.64"></a>
+<span class="sourceLineNo">065</span>    public DataSourceResolver[] getDataSourceResolvers()<a name="line.65"></a>
+<span class="sourceLineNo">066</span>    {<a name="line.66"></a>
+<span class="sourceLineNo">067</span>        // clone the internal array to prevent external modification (see EMAIL-116)<a name="line.67"></a>
+<span class="sourceLineNo">068</span>        final DataSourceResolver[] resolvers = new DataSourceResolver[dataSourceResolvers.length];<a name="line.68"></a>
+<span class="sourceLineNo">069</span>        System.arraycopy(dataSourceResolvers, 0, resolvers, 0, dataSourceResolvers.length);<a name="line.69"></a>
+<span class="sourceLineNo">070</span>        return resolvers;<a name="line.70"></a>
+<span class="sourceLineNo">071</span>    }<a name="line.71"></a>
+<span class="sourceLineNo">072</span><a name="line.72"></a>
+<span class="sourceLineNo">073</span>    /** {@inheritDoc} */<a name="line.73"></a>
+<span class="sourceLineNo">074</span>    public DataSource resolve(final String resourceLocation) throws IOException<a name="line.74"></a>
+<span class="sourceLineNo">075</span>    {<a name="line.75"></a>
+<span class="sourceLineNo">076</span>        final DataSource result = resolve(resourceLocation, true);<a name="line.76"></a>
+<span class="sourceLineNo">077</span><a name="line.77"></a>
+<span class="sourceLineNo">078</span>        if (isLenient() || result != null)<a name="line.78"></a>
+<span class="sourceLineNo">079</span>        {<a name="line.79"></a>
+<span class="sourceLineNo">080</span>            return result;<a name="line.80"></a>
+<span class="sourceLineNo">081</span>        }<a name="line.81"></a>
+<span class="sourceLineNo">082</span>        throw new IOException("The following resource was not found : " + resourceLocation);<a name="line.82"></a>
+<span class="sourceLineNo">083</span><a name="line.83"></a>
+<span class="sourceLineNo">084</span>    }<a name="line.84"></a>
+<span class="sourceLineNo">085</span><a name="line.85"></a>
+<span class="sourceLineNo">086</span>    /** {@inheritDoc} */<a name="line.86"></a>
+<span class="sourceLineNo">087</span>    public DataSource resolve(final String resourceLocation, final boolean isLenient) throws IOException<a name="line.87"></a>
+<span class="sourceLineNo">088</span>    {<a name="line.88"></a>
+<span class="sourceLineNo">089</span>        for (int i = 0; i &lt; getDataSourceResolvers().length; i++)<a name="line.89"></a>
+<span class="sourceLineNo">090</span>        {<a name="line.90"></a>
+<span class="sourceLineNo">091</span>            final DataSourceResolver dataSourceResolver = getDataSourceResolvers()[i];<a name="line.91"></a>
+<span class="sourceLineNo">092</span>            final DataSource dataSource = dataSourceResolver.resolve(resourceLocation, isLenient);<a name="line.92"></a>
+<span class="sourceLineNo">093</span><a name="line.93"></a>
+<span class="sourceLineNo">094</span>            if (dataSource != null)<a name="line.94"></a>
+<span class="sourceLineNo">095</span>            {<a name="line.95"></a>
+<span class="sourceLineNo">096</span>                return dataSource;<a name="line.96"></a>
+<span class="sourceLineNo">097</span>            }<a name="line.97"></a>
+<span class="sourceLineNo">098</span>        }<a name="line.98"></a>
+<span class="sourceLineNo">099</span><a name="line.99"></a>
+<span class="sourceLineNo">100</span>        if (isLenient)<a name="line.100"></a>
+<span class="sourceLineNo">101</span>        {<a name="line.101"></a>
+<span class="sourceLineNo">102</span>            return null;<a name="line.102"></a>
+<span class="sourceLineNo">103</span>        }<a name="line.103"></a>
+<span class="sourceLineNo">104</span>        throw new IOException("The following resource was not found : " + resourceLocation);<a name="line.104"></a>
+<span class="sourceLineNo">105</span>    }<a name="line.105"></a>
+<span class="sourceLineNo">106</span>}<a name="line.106"></a>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+</pre>
+</div>
+</body>
+</html>

Propchange: websites/production/commons/content/proper/commons-email/javadocs/api-release/src-html/org/apache/commons/mail/resolver/DataSourceCompositeResolver.html
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: websites/production/commons/content/proper/commons-email/javadocs/api-release/src-html/org/apache/commons/mail/resolver/DataSourceCompositeResolver.html
------------------------------------------------------------------------------
    svn:keywords = Id Revision HeadURL

Propchange: websites/production/commons/content/proper/commons-email/javadocs/api-release/src-html/org/apache/commons/mail/resolver/DataSourceCompositeResolver.html
------------------------------------------------------------------------------
    svn:mime-type = text/html

Added: websites/production/commons/content/proper/commons-email/javadocs/api-release/src-html/org/apache/commons/mail/resolver/DataSourceFileResolver.html
==============================================================================
--- websites/production/commons/content/proper/commons-email/javadocs/api-release/src-html/org/apache/commons/mail/resolver/DataSourceFileResolver.html (added)
+++ websites/production/commons/content/proper/commons-email/javadocs/api-release/src-html/org/apache/commons/mail/resolver/DataSourceFileResolver.html Sat May 23 18:45:36 2015
@@ -0,0 +1,184 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
+<html lang="en">
+<head>
+<title>Source code</title>
+<link rel="stylesheet" type="text/css" href="../../../../../../stylesheet.css" title="Style">
+</head>
+<body>
+<div class="sourceContainer">
+<pre><span class="sourceLineNo">001</span>/*<a name="line.1"></a>
+<span class="sourceLineNo">002</span> * Licensed to the Apache Software Foundation (ASF) under one or more<a name="line.2"></a>
+<span class="sourceLineNo">003</span> * contributor license agreements.  See the NOTICE file distributed with<a name="line.3"></a>
+<span class="sourceLineNo">004</span> * this work for additional information regarding copyright ownership.<a name="line.4"></a>
+<span class="sourceLineNo">005</span> * The ASF licenses this file to You under the Apache License, Version 2.0<a name="line.5"></a>
+<span class="sourceLineNo">006</span> * (the "License"); you may not use this file except in compliance with<a name="line.6"></a>
+<span class="sourceLineNo">007</span> * the License.  You may obtain a copy of the License at<a name="line.7"></a>
+<span class="sourceLineNo">008</span> *<a name="line.8"></a>
+<span class="sourceLineNo">009</span> *     http://www.apache.org/licenses/LICENSE-2.0<a name="line.9"></a>
+<span class="sourceLineNo">010</span> *<a name="line.10"></a>
+<span class="sourceLineNo">011</span> * Unless required by applicable law or agreed to in writing, software<a name="line.11"></a>
+<span class="sourceLineNo">012</span> * distributed under the License is distributed on an "AS IS" BASIS,<a name="line.12"></a>
+<span class="sourceLineNo">013</span> * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.<a name="line.13"></a>
+<span class="sourceLineNo">014</span> * See the License for the specific language governing permissions and<a name="line.14"></a>
+<span class="sourceLineNo">015</span> * limitations under the License.<a name="line.15"></a>
+<span class="sourceLineNo">016</span> */<a name="line.16"></a>
+<span class="sourceLineNo">017</span>package org.apache.commons.mail.resolver;<a name="line.17"></a>
+<span class="sourceLineNo">018</span><a name="line.18"></a>
+<span class="sourceLineNo">019</span>import javax.activation.DataSource;<a name="line.19"></a>
+<span class="sourceLineNo">020</span>import javax.activation.FileDataSource;<a name="line.20"></a>
+<span class="sourceLineNo">021</span>import java.io.File;<a name="line.21"></a>
+<span class="sourceLineNo">022</span>import java.io.IOException;<a name="line.22"></a>
+<span class="sourceLineNo">023</span><a name="line.23"></a>
+<span class="sourceLineNo">024</span>/**<a name="line.24"></a>
+<span class="sourceLineNo">025</span> * Creates a &lt;code&gt;DataSource&lt;/code&gt; based on an URL. The implementation<a name="line.25"></a>
+<span class="sourceLineNo">026</span> * also resolves file resources.<a name="line.26"></a>
+<span class="sourceLineNo">027</span> *<a name="line.27"></a>
+<span class="sourceLineNo">028</span> * @since 1.3<a name="line.28"></a>
+<span class="sourceLineNo">029</span> * @version $Id$<a name="line.29"></a>
+<span class="sourceLineNo">030</span> */<a name="line.30"></a>
+<span class="sourceLineNo">031</span>public class DataSourceFileResolver extends DataSourceBaseResolver<a name="line.31"></a>
+<span class="sourceLineNo">032</span>{<a name="line.32"></a>
+<span class="sourceLineNo">033</span>    /** the base directory of the resource when resolving relative paths */<a name="line.33"></a>
+<span class="sourceLineNo">034</span>    private final File baseDir;<a name="line.34"></a>
+<span class="sourceLineNo">035</span><a name="line.35"></a>
+<span class="sourceLineNo">036</span>    /**<a name="line.36"></a>
+<span class="sourceLineNo">037</span>     * Constructor.<a name="line.37"></a>
+<span class="sourceLineNo">038</span>     */<a name="line.38"></a>
+<span class="sourceLineNo">039</span>    public DataSourceFileResolver()<a name="line.39"></a>
+<span class="sourceLineNo">040</span>    {<a name="line.40"></a>
+<span class="sourceLineNo">041</span>        baseDir = new File(".");<a name="line.41"></a>
+<span class="sourceLineNo">042</span>    }<a name="line.42"></a>
+<span class="sourceLineNo">043</span><a name="line.43"></a>
+<span class="sourceLineNo">044</span>    /**<a name="line.44"></a>
+<span class="sourceLineNo">045</span>     * Constructor.<a name="line.45"></a>
+<span class="sourceLineNo">046</span>     *<a name="line.46"></a>
+<span class="sourceLineNo">047</span>     * @param baseDir the base directory of the resource when resolving relative paths<a name="line.47"></a>
+<span class="sourceLineNo">048</span>     */<a name="line.48"></a>
+<span class="sourceLineNo">049</span>    public DataSourceFileResolver(final File baseDir)<a name="line.49"></a>
+<span class="sourceLineNo">050</span>    {<a name="line.50"></a>
+<span class="sourceLineNo">051</span>        this.baseDir = baseDir;<a name="line.51"></a>
+<span class="sourceLineNo">052</span>    }<a name="line.52"></a>
+<span class="sourceLineNo">053</span><a name="line.53"></a>
+<span class="sourceLineNo">054</span>    /**<a name="line.54"></a>
+<span class="sourceLineNo">055</span>     * Constructor.<a name="line.55"></a>
+<span class="sourceLineNo">056</span>     *<a name="line.56"></a>
+<span class="sourceLineNo">057</span>     * @param baseDir the base directory of the resource when resolving relative paths<a name="line.57"></a>
+<span class="sourceLineNo">058</span>     * @param lenient shall we ignore resources not found or complain with an exception<a name="line.58"></a>
+<span class="sourceLineNo">059</span>     */<a name="line.59"></a>
+<span class="sourceLineNo">060</span>    public DataSourceFileResolver(final File baseDir, final boolean lenient)<a name="line.60"></a>
+<span class="sourceLineNo">061</span>    {<a name="line.61"></a>
+<span class="sourceLineNo">062</span>        super(lenient);<a name="line.62"></a>
+<span class="sourceLineNo">063</span>        this.baseDir = baseDir;<a name="line.63"></a>
+<span class="sourceLineNo">064</span>    }<a name="line.64"></a>
+<span class="sourceLineNo">065</span><a name="line.65"></a>
+<span class="sourceLineNo">066</span>    /**<a name="line.66"></a>
+<span class="sourceLineNo">067</span>     * Get the base directory used for resolving relative resource locations.<a name="line.67"></a>
+<span class="sourceLineNo">068</span>     *<a name="line.68"></a>
+<span class="sourceLineNo">069</span>     * @return the baseUrl<a name="line.69"></a>
+<span class="sourceLineNo">070</span>     */<a name="line.70"></a>
+<span class="sourceLineNo">071</span>    public File getBaseDir()<a name="line.71"></a>
+<span class="sourceLineNo">072</span>    {<a name="line.72"></a>
+<span class="sourceLineNo">073</span>        return baseDir;<a name="line.73"></a>
+<span class="sourceLineNo">074</span>    }<a name="line.74"></a>
+<span class="sourceLineNo">075</span><a name="line.75"></a>
+<span class="sourceLineNo">076</span>    /** {@inheritDoc} */<a name="line.76"></a>
+<span class="sourceLineNo">077</span>    public DataSource resolve(final String resourceLocation) throws IOException<a name="line.77"></a>
+<span class="sourceLineNo">078</span>    {<a name="line.78"></a>
+<span class="sourceLineNo">079</span>        return resolve(resourceLocation, isLenient());<a name="line.79"></a>
+<span class="sourceLineNo">080</span>    }<a name="line.80"></a>
+<span class="sourceLineNo">081</span><a name="line.81"></a>
+<span class="sourceLineNo">082</span>    /** {@inheritDoc} */<a name="line.82"></a>
+<span class="sourceLineNo">083</span>    public DataSource resolve(final String resourceLocation, final boolean isLenient) throws IOException<a name="line.83"></a>
+<span class="sourceLineNo">084</span>    {<a name="line.84"></a>
+<span class="sourceLineNo">085</span>        File file;<a name="line.85"></a>
+<span class="sourceLineNo">086</span>        DataSource result = null;<a name="line.86"></a>
+<span class="sourceLineNo">087</span><a name="line.87"></a>
+<span class="sourceLineNo">088</span>        if (!isCid(resourceLocation))<a name="line.88"></a>
+<span class="sourceLineNo">089</span>        {<a name="line.89"></a>
+<span class="sourceLineNo">090</span>            file = new File(resourceLocation);<a name="line.90"></a>
+<span class="sourceLineNo">091</span><a name="line.91"></a>
+<span class="sourceLineNo">092</span>            if (!file.isAbsolute())<a name="line.92"></a>
+<span class="sourceLineNo">093</span>            {<a name="line.93"></a>
+<span class="sourceLineNo">094</span>                file = getBaseDir() != null ? new File(getBaseDir(), resourceLocation) : new File(resourceLocation);<a name="line.94"></a>
+<span class="sourceLineNo">095</span>            }<a name="line.95"></a>
+<span class="sourceLineNo">096</span><a name="line.96"></a>
+<span class="sourceLineNo">097</span>            if (file.exists())<a name="line.97"></a>
+<span class="sourceLineNo">098</span>            {<a name="line.98"></a>
+<span class="sourceLineNo">099</span>                result = new FileDataSource(file);<a name="line.99"></a>
+<span class="sourceLineNo">100</span>            }<a name="line.100"></a>
+<span class="sourceLineNo">101</span>            else<a name="line.101"></a>
+<span class="sourceLineNo">102</span>            {<a name="line.102"></a>
+<span class="sourceLineNo">103</span>                if (!isLenient)<a name="line.103"></a>
+<span class="sourceLineNo">104</span>                {<a name="line.104"></a>
+<span class="sourceLineNo">105</span>                    throw new IOException("Cant resolve the following file resource :" + file.getAbsolutePath());<a name="line.105"></a>
+<span class="sourceLineNo">106</span>                }<a name="line.106"></a>
+<span class="sourceLineNo">107</span>            }<a name="line.107"></a>
+<span class="sourceLineNo">108</span>        }<a name="line.108"></a>
+<span class="sourceLineNo">109</span><a name="line.109"></a>
+<span class="sourceLineNo">110</span>        return result;<a name="line.110"></a>
+<span class="sourceLineNo">111</span>    }<a name="line.111"></a>
+<span class="sourceLineNo">112</span>}<a name="line.112"></a>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+</pre>
+</div>
+</body>
+</html>

Propchange: websites/production/commons/content/proper/commons-email/javadocs/api-release/src-html/org/apache/commons/mail/resolver/DataSourceFileResolver.html
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: websites/production/commons/content/proper/commons-email/javadocs/api-release/src-html/org/apache/commons/mail/resolver/DataSourceFileResolver.html
------------------------------------------------------------------------------
    svn:keywords = Id Revision HeadURL

Propchange: websites/production/commons/content/proper/commons-email/javadocs/api-release/src-html/org/apache/commons/mail/resolver/DataSourceFileResolver.html
------------------------------------------------------------------------------
    svn:mime-type = text/html

Added: websites/production/commons/content/proper/commons-email/javadocs/api-release/src-html/org/apache/commons/mail/resolver/DataSourceUrlResolver.html
==============================================================================
--- websites/production/commons/content/proper/commons-email/javadocs/api-release/src-html/org/apache/commons/mail/resolver/DataSourceUrlResolver.html (added)
+++ websites/production/commons/content/proper/commons-email/javadocs/api-release/src-html/org/apache/commons/mail/resolver/DataSourceUrlResolver.html Sat May 23 18:45:36 2015
@@ -0,0 +1,204 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
+<html lang="en">
+<head>
+<title>Source code</title>
+<link rel="stylesheet" type="text/css" href="../../../../../../stylesheet.css" title="Style">
+</head>
+<body>
+<div class="sourceContainer">
+<pre><span class="sourceLineNo">001</span>/*<a name="line.1"></a>
+<span class="sourceLineNo">002</span> * Licensed to the Apache Software Foundation (ASF) under one or more<a name="line.2"></a>
+<span class="sourceLineNo">003</span> * contributor license agreements.  See the NOTICE file distributed with<a name="line.3"></a>
+<span class="sourceLineNo">004</span> * this work for additional information regarding copyright ownership.<a name="line.4"></a>
+<span class="sourceLineNo">005</span> * The ASF licenses this file to You under the Apache License, Version 2.0<a name="line.5"></a>
+<span class="sourceLineNo">006</span> * (the "License"); you may not use this file except in compliance with<a name="line.6"></a>
+<span class="sourceLineNo">007</span> * the License.  You may obtain a copy of the License at<a name="line.7"></a>
+<span class="sourceLineNo">008</span> *<a name="line.8"></a>
+<span class="sourceLineNo">009</span> *     http://www.apache.org/licenses/LICENSE-2.0<a name="line.9"></a>
+<span class="sourceLineNo">010</span> *<a name="line.10"></a>
+<span class="sourceLineNo">011</span> * Unless required by applicable law or agreed to in writing, software<a name="line.11"></a>
+<span class="sourceLineNo">012</span> * distributed under the License is distributed on an "AS IS" BASIS,<a name="line.12"></a>
+<span class="sourceLineNo">013</span> * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.<a name="line.13"></a>
+<span class="sourceLineNo">014</span> * See the License for the specific language governing permissions and<a name="line.14"></a>
+<span class="sourceLineNo">015</span> * limitations under the License.<a name="line.15"></a>
+<span class="sourceLineNo">016</span> */<a name="line.16"></a>
+<span class="sourceLineNo">017</span>package org.apache.commons.mail.resolver;<a name="line.17"></a>
+<span class="sourceLineNo">018</span><a name="line.18"></a>
+<span class="sourceLineNo">019</span>import javax.activation.DataSource;<a name="line.19"></a>
+<span class="sourceLineNo">020</span>import javax.activation.URLDataSource;<a name="line.20"></a>
+<span class="sourceLineNo">021</span>import java.io.IOException;<a name="line.21"></a>
+<span class="sourceLineNo">022</span>import java.net.MalformedURLException;<a name="line.22"></a>
+<span class="sourceLineNo">023</span>import java.net.URL;<a name="line.23"></a>
+<span class="sourceLineNo">024</span><a name="line.24"></a>
+<span class="sourceLineNo">025</span>/**<a name="line.25"></a>
+<span class="sourceLineNo">026</span> * Creates a &lt;code&gt;DataSource&lt;/code&gt; based on an URL.<a name="line.26"></a>
+<span class="sourceLineNo">027</span> *<a name="line.27"></a>
+<span class="sourceLineNo">028</span> * @since 1.3<a name="line.28"></a>
+<span class="sourceLineNo">029</span> * @version $Id$<a name="line.29"></a>
+<span class="sourceLineNo">030</span> */<a name="line.30"></a>
+<span class="sourceLineNo">031</span>public class DataSourceUrlResolver extends DataSourceBaseResolver<a name="line.31"></a>
+<span class="sourceLineNo">032</span>{<a name="line.32"></a>
+<span class="sourceLineNo">033</span>    /** the base url of the resource when resolving relative paths */<a name="line.33"></a>
+<span class="sourceLineNo">034</span>    private final URL baseUrl;<a name="line.34"></a>
+<span class="sourceLineNo">035</span><a name="line.35"></a>
+<span class="sourceLineNo">036</span>    /**<a name="line.36"></a>
+<span class="sourceLineNo">037</span>     * Constructor.<a name="line.37"></a>
+<span class="sourceLineNo">038</span>     *<a name="line.38"></a>
+<span class="sourceLineNo">039</span>     * @param baseUrl the base URL used for resolving relative resource locations<a name="line.39"></a>
+<span class="sourceLineNo">040</span>     */<a name="line.40"></a>
+<span class="sourceLineNo">041</span>    public DataSourceUrlResolver(final URL baseUrl)<a name="line.41"></a>
+<span class="sourceLineNo">042</span>    {<a name="line.42"></a>
+<span class="sourceLineNo">043</span>        super();<a name="line.43"></a>
+<span class="sourceLineNo">044</span>        this.baseUrl = baseUrl;<a name="line.44"></a>
+<span class="sourceLineNo">045</span>    }<a name="line.45"></a>
+<span class="sourceLineNo">046</span><a name="line.46"></a>
+<span class="sourceLineNo">047</span>    /**<a name="line.47"></a>
+<span class="sourceLineNo">048</span>     * Constructor.<a name="line.48"></a>
+<span class="sourceLineNo">049</span>     *<a name="line.49"></a>
+<span class="sourceLineNo">050</span>     * @param baseUrl the base URL used for resolving relative resource locations<a name="line.50"></a>
+<span class="sourceLineNo">051</span>     * @param lenient shall we ignore resources not found or complain with an exception<a name="line.51"></a>
+<span class="sourceLineNo">052</span>     */<a name="line.52"></a>
+<span class="sourceLineNo">053</span>    public DataSourceUrlResolver(final URL baseUrl, final boolean lenient)<a name="line.53"></a>
+<span class="sourceLineNo">054</span>    {<a name="line.54"></a>
+<span class="sourceLineNo">055</span>        super(lenient);<a name="line.55"></a>
+<span class="sourceLineNo">056</span>        this.baseUrl = baseUrl;<a name="line.56"></a>
+<span class="sourceLineNo">057</span>    }<a name="line.57"></a>
+<span class="sourceLineNo">058</span><a name="line.58"></a>
+<span class="sourceLineNo">059</span>    /**<a name="line.59"></a>
+<span class="sourceLineNo">060</span>     * Get the base URL used for resolving relative resource locations.<a name="line.60"></a>
+<span class="sourceLineNo">061</span>     *<a name="line.61"></a>
+<span class="sourceLineNo">062</span>     * @return the baseUrl<a name="line.62"></a>
+<span class="sourceLineNo">063</span>     */<a name="line.63"></a>
+<span class="sourceLineNo">064</span>    public URL getBaseUrl()<a name="line.64"></a>
+<span class="sourceLineNo">065</span>    {<a name="line.65"></a>
+<span class="sourceLineNo">066</span>        return baseUrl;<a name="line.66"></a>
+<span class="sourceLineNo">067</span>    }<a name="line.67"></a>
+<span class="sourceLineNo">068</span><a name="line.68"></a>
+<span class="sourceLineNo">069</span>    /** {@inheritDoc} */<a name="line.69"></a>
+<span class="sourceLineNo">070</span>    public DataSource resolve(final String resourceLocation) throws IOException<a name="line.70"></a>
+<span class="sourceLineNo">071</span>    {<a name="line.71"></a>
+<span class="sourceLineNo">072</span>        return resolve(resourceLocation, isLenient());<a name="line.72"></a>
+<span class="sourceLineNo">073</span>    }<a name="line.73"></a>
+<span class="sourceLineNo">074</span><a name="line.74"></a>
+<span class="sourceLineNo">075</span>    /** {@inheritDoc} */<a name="line.75"></a>
+<span class="sourceLineNo">076</span>    public DataSource resolve(final String resourceLocation, final boolean isLenient) throws IOException<a name="line.76"></a>
+<span class="sourceLineNo">077</span>    {<a name="line.77"></a>
+<span class="sourceLineNo">078</span>        DataSource result = null;<a name="line.78"></a>
+<span class="sourceLineNo">079</span><a name="line.79"></a>
+<span class="sourceLineNo">080</span>        try<a name="line.80"></a>
+<span class="sourceLineNo">081</span>        {<a name="line.81"></a>
+<span class="sourceLineNo">082</span>            if (!isCid(resourceLocation))<a name="line.82"></a>
+<span class="sourceLineNo">083</span>            {<a name="line.83"></a>
+<span class="sourceLineNo">084</span>                final URL url = createUrl(resourceLocation);<a name="line.84"></a>
+<span class="sourceLineNo">085</span>                result = new URLDataSource(url);<a name="line.85"></a>
+<span class="sourceLineNo">086</span>                result.getInputStream();<a name="line.86"></a>
+<span class="sourceLineNo">087</span>            }<a name="line.87"></a>
+<span class="sourceLineNo">088</span><a name="line.88"></a>
+<span class="sourceLineNo">089</span>            return result;<a name="line.89"></a>
+<span class="sourceLineNo">090</span>        }<a name="line.90"></a>
+<span class="sourceLineNo">091</span>        catch (final IOException e)<a name="line.91"></a>
+<span class="sourceLineNo">092</span>        {<a name="line.92"></a>
+<span class="sourceLineNo">093</span>            if (isLenient)<a name="line.93"></a>
+<span class="sourceLineNo">094</span>            {<a name="line.94"></a>
+<span class="sourceLineNo">095</span>                return null;<a name="line.95"></a>
+<span class="sourceLineNo">096</span>            }<a name="line.96"></a>
+<span class="sourceLineNo">097</span>            throw e;<a name="line.97"></a>
+<span class="sourceLineNo">098</span>        }<a name="line.98"></a>
+<span class="sourceLineNo">099</span>    }<a name="line.99"></a>
+<span class="sourceLineNo">100</span><a name="line.100"></a>
+<span class="sourceLineNo">101</span>    /**<a name="line.101"></a>
+<span class="sourceLineNo">102</span>     * Create an URL based on a base URL and a resource location suitable for loading<a name="line.102"></a>
+<span class="sourceLineNo">103</span>     * the resource.<a name="line.103"></a>
+<span class="sourceLineNo">104</span>     *<a name="line.104"></a>
+<span class="sourceLineNo">105</span>     * @param resourceLocation a resource location<a name="line.105"></a>
+<span class="sourceLineNo">106</span>     * @return the corresponding URL<a name="line.106"></a>
+<span class="sourceLineNo">107</span>     * @throws java.net.MalformedURLException creating the URL failed<a name="line.107"></a>
+<span class="sourceLineNo">108</span>     */<a name="line.108"></a>
+<span class="sourceLineNo">109</span>    protected URL createUrl(final String resourceLocation) throws MalformedURLException<a name="line.109"></a>
+<span class="sourceLineNo">110</span>    {<a name="line.110"></a>
+<span class="sourceLineNo">111</span>        // if we get an non-existing base url than the resource can<a name="line.111"></a>
+<span class="sourceLineNo">112</span>        // be directly used to create an URL<a name="line.112"></a>
+<span class="sourceLineNo">113</span>        if (baseUrl == null)<a name="line.113"></a>
+<span class="sourceLineNo">114</span>        {<a name="line.114"></a>
+<span class="sourceLineNo">115</span>            return new URL(resourceLocation);<a name="line.115"></a>
+<span class="sourceLineNo">116</span>        }<a name="line.116"></a>
+<span class="sourceLineNo">117</span><a name="line.117"></a>
+<span class="sourceLineNo">118</span>        // if we get an non-existing location what we shall do?<a name="line.118"></a>
+<span class="sourceLineNo">119</span>        if (resourceLocation == null || resourceLocation.length() == 0)<a name="line.119"></a>
+<span class="sourceLineNo">120</span>        {<a name="line.120"></a>
+<span class="sourceLineNo">121</span>            throw new IllegalArgumentException("No resource defined");<a name="line.121"></a>
+<span class="sourceLineNo">122</span>        }<a name="line.122"></a>
+<span class="sourceLineNo">123</span><a name="line.123"></a>
+<span class="sourceLineNo">124</span>        // if we get a stand-alone resource than ignore the base url<a name="line.124"></a>
+<span class="sourceLineNo">125</span>        if (isFileUrl(resourceLocation) || isHttpUrl(resourceLocation))<a name="line.125"></a>
+<span class="sourceLineNo">126</span>        {<a name="line.126"></a>
+<span class="sourceLineNo">127</span>            return new URL(resourceLocation);<a name="line.127"></a>
+<span class="sourceLineNo">128</span>        }<a name="line.128"></a>
+<span class="sourceLineNo">129</span><a name="line.129"></a>
+<span class="sourceLineNo">130</span>        return new URL(getBaseUrl(), resourceLocation.replaceAll("&amp;amp;", "&amp;"));<a name="line.130"></a>
+<span class="sourceLineNo">131</span>    }<a name="line.131"></a>
+<span class="sourceLineNo">132</span>}<a name="line.132"></a>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+</pre>
+</div>
+</body>
+</html>

Propchange: websites/production/commons/content/proper/commons-email/javadocs/api-release/src-html/org/apache/commons/mail/resolver/DataSourceUrlResolver.html
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: websites/production/commons/content/proper/commons-email/javadocs/api-release/src-html/org/apache/commons/mail/resolver/DataSourceUrlResolver.html
------------------------------------------------------------------------------
    svn:keywords = Id Revision HeadURL

Propchange: websites/production/commons/content/proper/commons-email/javadocs/api-release/src-html/org/apache/commons/mail/resolver/DataSourceUrlResolver.html
------------------------------------------------------------------------------
    svn:mime-type = text/html



Mime
View raw message