commons-notifications mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From chtom...@apache.org
Subject svn commit: r1013974 [41/43] - in /websites/production/commons/content/proper/commons-fileupload/javadocs: ./ api-release/ api-release/org/ api-release/org/apache/ api-release/org/apache/commons/ api-release/org/apache/commons/fileupload/ api-release/o...
Date Tue, 13 Jun 2017 12:48:40 GMT
Added: websites/production/commons/content/proper/commons-fileupload/javadocs/api-release/src-html/org/apache/commons/fileupload/disk/DiskFileItemFactory.html
==============================================================================
--- websites/production/commons/content/proper/commons-fileupload/javadocs/api-release/src-html/org/apache/commons/fileupload/disk/DiskFileItemFactory.html (added)
+++ websites/production/commons/content/proper/commons-fileupload/javadocs/api-release/src-html/org/apache/commons/fileupload/disk/DiskFileItemFactory.html Tue Jun 13 12:48:38 2017
@@ -0,0 +1,299 @@
+<!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.fileupload.disk;<a name="line.17"></a>
+<span class="sourceLineNo">018</span><a name="line.18"></a>
+<span class="sourceLineNo">019</span>import java.io.File;<a name="line.19"></a>
+<span class="sourceLineNo">020</span><a name="line.20"></a>
+<span class="sourceLineNo">021</span>import org.apache.commons.fileupload.FileItem;<a name="line.21"></a>
+<span class="sourceLineNo">022</span>import org.apache.commons.fileupload.FileItemFactory;<a name="line.22"></a>
+<span class="sourceLineNo">023</span>import org.apache.commons.io.FileCleaningTracker;<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> * &lt;p&gt;The default {@link org.apache.commons.fileupload.FileItemFactory}<a name="line.26"></a>
+<span class="sourceLineNo">027</span> * implementation. This implementation creates<a name="line.27"></a>
+<span class="sourceLineNo">028</span> * {@link org.apache.commons.fileupload.FileItem} instances which keep their<a name="line.28"></a>
+<span class="sourceLineNo">029</span> * content either in memory, for smaller items, or in a temporary file on disk,<a name="line.29"></a>
+<span class="sourceLineNo">030</span> * for larger items. The size threshold, above which content will be stored on<a name="line.30"></a>
+<span class="sourceLineNo">031</span> * disk, is configurable, as is the directory in which temporary files will be<a name="line.31"></a>
+<span class="sourceLineNo">032</span> * created.&lt;/p&gt;<a name="line.32"></a>
+<span class="sourceLineNo">033</span> *<a name="line.33"></a>
+<span class="sourceLineNo">034</span> * &lt;p&gt;If not otherwise configured, the default configuration values are as<a name="line.34"></a>
+<span class="sourceLineNo">035</span> * follows:&lt;/p&gt;<a name="line.35"></a>
+<span class="sourceLineNo">036</span> * &lt;ul&gt;<a name="line.36"></a>
+<span class="sourceLineNo">037</span> *   &lt;li&gt;Size threshold is 10KB.&lt;/li&gt;<a name="line.37"></a>
+<span class="sourceLineNo">038</span> *   &lt;li&gt;Repository is the system default temp directory, as returned by<a name="line.38"></a>
+<span class="sourceLineNo">039</span> *       &lt;code&gt;System.getProperty("java.io.tmpdir")&lt;/code&gt;.&lt;/li&gt;<a name="line.39"></a>
+<span class="sourceLineNo">040</span> * &lt;/ul&gt;<a name="line.40"></a>
+<span class="sourceLineNo">041</span> * &lt;p&gt;<a name="line.41"></a>
+<span class="sourceLineNo">042</span> * &lt;b&gt;NOTE&lt;/b&gt;: Files are created in the system default temp directory with<a name="line.42"></a>
+<span class="sourceLineNo">043</span> * predictable names. This means that a local attacker with write access to that<a name="line.43"></a>
+<span class="sourceLineNo">044</span> * directory can perform a TOUTOC attack to replace any uploaded file with a<a name="line.44"></a>
+<span class="sourceLineNo">045</span> * file of the attackers choice. The implications of this will depend on how the<a name="line.45"></a>
+<span class="sourceLineNo">046</span> * uploaded file is used but could be significant. When using this<a name="line.46"></a>
+<span class="sourceLineNo">047</span> * implementation in an environment with local, untrusted users,<a name="line.47"></a>
+<span class="sourceLineNo">048</span> * {@link #setRepository(File)} MUST be used to configure a repository location<a name="line.48"></a>
+<span class="sourceLineNo">049</span> * that is not publicly writable. In a Servlet container the location identified<a name="line.49"></a>
+<span class="sourceLineNo">050</span> * by the ServletContext attribute &lt;code&gt;javax.servlet.context.tempdir&lt;/code&gt;<a name="line.50"></a>
+<span class="sourceLineNo">051</span> * may be used.<a name="line.51"></a>
+<span class="sourceLineNo">052</span> * &lt;/p&gt;<a name="line.52"></a>
+<span class="sourceLineNo">053</span> *<a name="line.53"></a>
+<span class="sourceLineNo">054</span> * &lt;p&gt;Temporary files, which are created for file items, should be<a name="line.54"></a>
+<span class="sourceLineNo">055</span> * deleted later on. The best way to do this is using a<a name="line.55"></a>
+<span class="sourceLineNo">056</span> * {@link FileCleaningTracker}, which you can set on the<a name="line.56"></a>
+<span class="sourceLineNo">057</span> * {@link DiskFileItemFactory}. However, if you do use such a tracker,<a name="line.57"></a>
+<span class="sourceLineNo">058</span> * then you must consider the following: Temporary files are automatically<a name="line.58"></a>
+<span class="sourceLineNo">059</span> * deleted as soon as they are no longer needed. (More precisely, when the<a name="line.59"></a>
+<span class="sourceLineNo">060</span> * corresponding instance of {@link java.io.File} is garbage collected.)<a name="line.60"></a>
+<span class="sourceLineNo">061</span> * This is done by the so-called reaper thread, which is started and stopped<a name="line.61"></a>
+<span class="sourceLineNo">062</span> * automatically by the {@link FileCleaningTracker} when there are files to be<a name="line.62"></a>
+<span class="sourceLineNo">063</span> * tracked.<a name="line.63"></a>
+<span class="sourceLineNo">064</span> * It might make sense to terminate that thread, for example, if<a name="line.64"></a>
+<span class="sourceLineNo">065</span> * your web application ends. See the section on "Resource cleanup"<a name="line.65"></a>
+<span class="sourceLineNo">066</span> * in the users guide of commons-fileupload.&lt;/p&gt;<a name="line.66"></a>
+<span class="sourceLineNo">067</span> *<a name="line.67"></a>
+<span class="sourceLineNo">068</span> * @since FileUpload 1.1<a name="line.68"></a>
+<span class="sourceLineNo">069</span> *<a name="line.69"></a>
+<span class="sourceLineNo">070</span> * @version $Id$<a name="line.70"></a>
+<span class="sourceLineNo">071</span> */<a name="line.71"></a>
+<span class="sourceLineNo">072</span>public class DiskFileItemFactory implements FileItemFactory {<a name="line.72"></a>
+<span class="sourceLineNo">073</span><a name="line.73"></a>
+<span class="sourceLineNo">074</span>    // ----------------------------------------------------- Manifest constants<a name="line.74"></a>
+<span class="sourceLineNo">075</span><a name="line.75"></a>
+<span class="sourceLineNo">076</span>    /**<a name="line.76"></a>
+<span class="sourceLineNo">077</span>     * The default threshold above which uploads will be stored on disk.<a name="line.77"></a>
+<span class="sourceLineNo">078</span>     */<a name="line.78"></a>
+<span class="sourceLineNo">079</span>    public static final int DEFAULT_SIZE_THRESHOLD = 10240;<a name="line.79"></a>
+<span class="sourceLineNo">080</span><a name="line.80"></a>
+<span class="sourceLineNo">081</span>    // ----------------------------------------------------- Instance Variables<a name="line.81"></a>
+<span class="sourceLineNo">082</span><a name="line.82"></a>
+<span class="sourceLineNo">083</span>    /**<a name="line.83"></a>
+<span class="sourceLineNo">084</span>     * The directory in which uploaded files will be stored, if stored on disk.<a name="line.84"></a>
+<span class="sourceLineNo">085</span>     */<a name="line.85"></a>
+<span class="sourceLineNo">086</span>    private File repository;<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>     * The threshold above which uploads will be stored on disk.<a name="line.89"></a>
+<span class="sourceLineNo">090</span>     */<a name="line.90"></a>
+<span class="sourceLineNo">091</span>    private int sizeThreshold = DEFAULT_SIZE_THRESHOLD;<a name="line.91"></a>
+<span class="sourceLineNo">092</span><a name="line.92"></a>
+<span class="sourceLineNo">093</span>    /**<a name="line.93"></a>
+<span class="sourceLineNo">094</span>     * &lt;p&gt;The instance of {@link FileCleaningTracker}, which is responsible<a name="line.94"></a>
+<span class="sourceLineNo">095</span>     * for deleting temporary files.&lt;/p&gt;<a name="line.95"></a>
+<span class="sourceLineNo">096</span>     * &lt;p&gt;May be null, if tracking files is not required.&lt;/p&gt;<a name="line.96"></a>
+<span class="sourceLineNo">097</span>     */<a name="line.97"></a>
+<span class="sourceLineNo">098</span>    private FileCleaningTracker fileCleaningTracker;<a name="line.98"></a>
+<span class="sourceLineNo">099</span><a name="line.99"></a>
+<span class="sourceLineNo">100</span>    // ----------------------------------------------------------- Constructors<a name="line.100"></a>
+<span class="sourceLineNo">101</span><a name="line.101"></a>
+<span class="sourceLineNo">102</span>    /**<a name="line.102"></a>
+<span class="sourceLineNo">103</span>     * Constructs an unconfigured instance of this class. The resulting factory<a name="line.103"></a>
+<span class="sourceLineNo">104</span>     * may be configured by calling the appropriate setter methods.<a name="line.104"></a>
+<span class="sourceLineNo">105</span>     */<a name="line.105"></a>
+<span class="sourceLineNo">106</span>    public DiskFileItemFactory() {<a name="line.106"></a>
+<span class="sourceLineNo">107</span>        this(DEFAULT_SIZE_THRESHOLD, null);<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>    /**<a name="line.110"></a>
+<span class="sourceLineNo">111</span>     * Constructs a preconfigured instance of this class.<a name="line.111"></a>
+<span class="sourceLineNo">112</span>     *<a name="line.112"></a>
+<span class="sourceLineNo">113</span>     * @param sizeThreshold The threshold, in bytes, below which items will be<a name="line.113"></a>
+<span class="sourceLineNo">114</span>     *                      retained in memory and above which they will be<a name="line.114"></a>
+<span class="sourceLineNo">115</span>     *                      stored as a file.<a name="line.115"></a>
+<span class="sourceLineNo">116</span>     * @param repository    The data repository, which is the directory in<a name="line.116"></a>
+<span class="sourceLineNo">117</span>     *                      which files will be created, should the item size<a name="line.117"></a>
+<span class="sourceLineNo">118</span>     *                      exceed the threshold.<a name="line.118"></a>
+<span class="sourceLineNo">119</span>     */<a name="line.119"></a>
+<span class="sourceLineNo">120</span>    public DiskFileItemFactory(int sizeThreshold, File repository) {<a name="line.120"></a>
+<span class="sourceLineNo">121</span>        this.sizeThreshold = sizeThreshold;<a name="line.121"></a>
+<span class="sourceLineNo">122</span>        this.repository = repository;<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>    // ------------------------------------------------------------- Properties<a name="line.125"></a>
+<span class="sourceLineNo">126</span><a name="line.126"></a>
+<span class="sourceLineNo">127</span>    /**<a name="line.127"></a>
+<span class="sourceLineNo">128</span>     * Returns the directory used to temporarily store files that are larger<a name="line.128"></a>
+<span class="sourceLineNo">129</span>     * than the configured size threshold.<a name="line.129"></a>
+<span class="sourceLineNo">130</span>     *<a name="line.130"></a>
+<span class="sourceLineNo">131</span>     * @return The directory in which temporary files will be located.<a name="line.131"></a>
+<span class="sourceLineNo">132</span>     *<a name="line.132"></a>
+<span class="sourceLineNo">133</span>     * @see #setRepository(java.io.File)<a name="line.133"></a>
+<span class="sourceLineNo">134</span>     *<a name="line.134"></a>
+<span class="sourceLineNo">135</span>     */<a name="line.135"></a>
+<span class="sourceLineNo">136</span>    public File getRepository() {<a name="line.136"></a>
+<span class="sourceLineNo">137</span>        return repository;<a name="line.137"></a>
+<span class="sourceLineNo">138</span>    }<a name="line.138"></a>
+<span class="sourceLineNo">139</span><a name="line.139"></a>
+<span class="sourceLineNo">140</span>    /**<a name="line.140"></a>
+<span class="sourceLineNo">141</span>     * Sets the directory used to temporarily store files that are larger<a name="line.141"></a>
+<span class="sourceLineNo">142</span>     * than the configured size threshold.<a name="line.142"></a>
+<span class="sourceLineNo">143</span>     *<a name="line.143"></a>
+<span class="sourceLineNo">144</span>     * @param repository The directory in which temporary files will be located.<a name="line.144"></a>
+<span class="sourceLineNo">145</span>     *<a name="line.145"></a>
+<span class="sourceLineNo">146</span>     * @see #getRepository()<a name="line.146"></a>
+<span class="sourceLineNo">147</span>     *<a name="line.147"></a>
+<span class="sourceLineNo">148</span>     */<a name="line.148"></a>
+<span class="sourceLineNo">149</span>    public void setRepository(File repository) {<a name="line.149"></a>
+<span class="sourceLineNo">150</span>        this.repository = repository;<a name="line.150"></a>
+<span class="sourceLineNo">151</span>    }<a name="line.151"></a>
+<span class="sourceLineNo">152</span><a name="line.152"></a>
+<span class="sourceLineNo">153</span>    /**<a name="line.153"></a>
+<span class="sourceLineNo">154</span>     * Returns the size threshold beyond which files are written directly to<a name="line.154"></a>
+<span class="sourceLineNo">155</span>     * disk. The default value is 10240 bytes.<a name="line.155"></a>
+<span class="sourceLineNo">156</span>     *<a name="line.156"></a>
+<span class="sourceLineNo">157</span>     * @return The size threshold, in bytes.<a name="line.157"></a>
+<span class="sourceLineNo">158</span>     *<a name="line.158"></a>
+<span class="sourceLineNo">159</span>     * @see #setSizeThreshold(int)<a name="line.159"></a>
+<span class="sourceLineNo">160</span>     */<a name="line.160"></a>
+<span class="sourceLineNo">161</span>    public int getSizeThreshold() {<a name="line.161"></a>
+<span class="sourceLineNo">162</span>        return sizeThreshold;<a name="line.162"></a>
+<span class="sourceLineNo">163</span>    }<a name="line.163"></a>
+<span class="sourceLineNo">164</span><a name="line.164"></a>
+<span class="sourceLineNo">165</span>    /**<a name="line.165"></a>
+<span class="sourceLineNo">166</span>     * Sets the size threshold beyond which files are written directly to disk.<a name="line.166"></a>
+<span class="sourceLineNo">167</span>     *<a name="line.167"></a>
+<span class="sourceLineNo">168</span>     * @param sizeThreshold The size threshold, in bytes.<a name="line.168"></a>
+<span class="sourceLineNo">169</span>     *<a name="line.169"></a>
+<span class="sourceLineNo">170</span>     * @see #getSizeThreshold()<a name="line.170"></a>
+<span class="sourceLineNo">171</span>     *<a name="line.171"></a>
+<span class="sourceLineNo">172</span>     */<a name="line.172"></a>
+<span class="sourceLineNo">173</span>    public void setSizeThreshold(int sizeThreshold) {<a name="line.173"></a>
+<span class="sourceLineNo">174</span>        this.sizeThreshold = sizeThreshold;<a name="line.174"></a>
+<span class="sourceLineNo">175</span>    }<a name="line.175"></a>
+<span class="sourceLineNo">176</span><a name="line.176"></a>
+<span class="sourceLineNo">177</span>    // --------------------------------------------------------- Public Methods<a name="line.177"></a>
+<span class="sourceLineNo">178</span><a name="line.178"></a>
+<span class="sourceLineNo">179</span>    /**<a name="line.179"></a>
+<span class="sourceLineNo">180</span>     * Create a new {@link org.apache.commons.fileupload.disk.DiskFileItem}<a name="line.180"></a>
+<span class="sourceLineNo">181</span>     * instance from the supplied parameters and the local factory<a name="line.181"></a>
+<span class="sourceLineNo">182</span>     * configuration.<a name="line.182"></a>
+<span class="sourceLineNo">183</span>     *<a name="line.183"></a>
+<span class="sourceLineNo">184</span>     * @param fieldName   The name of the form field.<a name="line.184"></a>
+<span class="sourceLineNo">185</span>     * @param contentType The content type of the form field.<a name="line.185"></a>
+<span class="sourceLineNo">186</span>     * @param isFormField &lt;code&gt;true&lt;/code&gt; if this is a plain form field;<a name="line.186"></a>
+<span class="sourceLineNo">187</span>     *                    &lt;code&gt;false&lt;/code&gt; otherwise.<a name="line.187"></a>
+<span class="sourceLineNo">188</span>     * @param fileName    The name of the uploaded file, if any, as supplied<a name="line.188"></a>
+<span class="sourceLineNo">189</span>     *                    by the browser or other client.<a name="line.189"></a>
+<span class="sourceLineNo">190</span>     *<a name="line.190"></a>
+<span class="sourceLineNo">191</span>     * @return The newly created file item.<a name="line.191"></a>
+<span class="sourceLineNo">192</span>     */<a name="line.192"></a>
+<span class="sourceLineNo">193</span>    public FileItem createItem(String fieldName, String contentType,<a name="line.193"></a>
+<span class="sourceLineNo">194</span>            boolean isFormField, String fileName) {<a name="line.194"></a>
+<span class="sourceLineNo">195</span>        DiskFileItem result = new DiskFileItem(fieldName, contentType,<a name="line.195"></a>
+<span class="sourceLineNo">196</span>                isFormField, fileName, sizeThreshold, repository);<a name="line.196"></a>
+<span class="sourceLineNo">197</span>        FileCleaningTracker tracker = getFileCleaningTracker();<a name="line.197"></a>
+<span class="sourceLineNo">198</span>        if (tracker != null) {<a name="line.198"></a>
+<span class="sourceLineNo">199</span>            tracker.track(result.getTempFile(), result);<a name="line.199"></a>
+<span class="sourceLineNo">200</span>        }<a name="line.200"></a>
+<span class="sourceLineNo">201</span>        return result;<a name="line.201"></a>
+<span class="sourceLineNo">202</span>    }<a name="line.202"></a>
+<span class="sourceLineNo">203</span><a name="line.203"></a>
+<span class="sourceLineNo">204</span>    /**<a name="line.204"></a>
+<span class="sourceLineNo">205</span>     * Returns the tracker, which is responsible for deleting temporary<a name="line.205"></a>
+<span class="sourceLineNo">206</span>     * files.<a name="line.206"></a>
+<span class="sourceLineNo">207</span>     *<a name="line.207"></a>
+<span class="sourceLineNo">208</span>     * @return An instance of {@link FileCleaningTracker}, or null<a name="line.208"></a>
+<span class="sourceLineNo">209</span>     *   (default), if temporary files aren't tracked.<a name="line.209"></a>
+<span class="sourceLineNo">210</span>     */<a name="line.210"></a>
+<span class="sourceLineNo">211</span>    public FileCleaningTracker getFileCleaningTracker() {<a name="line.211"></a>
+<span class="sourceLineNo">212</span>        return fileCleaningTracker;<a name="line.212"></a>
+<span class="sourceLineNo">213</span>    }<a name="line.213"></a>
+<span class="sourceLineNo">214</span><a name="line.214"></a>
+<span class="sourceLineNo">215</span>    /**<a name="line.215"></a>
+<span class="sourceLineNo">216</span>     * Sets the tracker, which is responsible for deleting temporary<a name="line.216"></a>
+<span class="sourceLineNo">217</span>     * files.<a name="line.217"></a>
+<span class="sourceLineNo">218</span>     *<a name="line.218"></a>
+<span class="sourceLineNo">219</span>     * @param pTracker An instance of {@link FileCleaningTracker},<a name="line.219"></a>
+<span class="sourceLineNo">220</span>     *   which will from now on track the created files, or null<a name="line.220"></a>
+<span class="sourceLineNo">221</span>     *   (default), to disable tracking.<a name="line.221"></a>
+<span class="sourceLineNo">222</span>     */<a name="line.222"></a>
+<span class="sourceLineNo">223</span>    public void setFileCleaningTracker(FileCleaningTracker pTracker) {<a name="line.223"></a>
+<span class="sourceLineNo">224</span>        fileCleaningTracker = pTracker;<a name="line.224"></a>
+<span class="sourceLineNo">225</span>    }<a name="line.225"></a>
+<span class="sourceLineNo">226</span><a name="line.226"></a>
+<span class="sourceLineNo">227</span>}<a name="line.227"></a>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+</pre>
+</div>
+</body>
+</html>

Added: websites/production/commons/content/proper/commons-fileupload/javadocs/api-release/src-html/org/apache/commons/fileupload/portlet/PortletFileUpload.html
==============================================================================
--- websites/production/commons/content/proper/commons-fileupload/javadocs/api-release/src-html/org/apache/commons/fileupload/portlet/PortletFileUpload.html (added)
+++ websites/production/commons/content/proper/commons-fileupload/javadocs/api-release/src-html/org/apache/commons/fileupload/portlet/PortletFileUpload.html Tue Jun 13 12:48:38 2017
@@ -0,0 +1,223 @@
+<!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.fileupload.portlet;<a name="line.17"></a>
+<span class="sourceLineNo">018</span><a name="line.18"></a>
+<span class="sourceLineNo">019</span>import java.io.IOException;<a name="line.19"></a>
+<span class="sourceLineNo">020</span>import java.util.List;<a name="line.20"></a>
+<span class="sourceLineNo">021</span>import java.util.Map;<a name="line.21"></a>
+<span class="sourceLineNo">022</span><a name="line.22"></a>
+<span class="sourceLineNo">023</span>import javax.portlet.ActionRequest;<a name="line.23"></a>
+<span class="sourceLineNo">024</span><a name="line.24"></a>
+<span class="sourceLineNo">025</span>import org.apache.commons.fileupload.FileItem;<a name="line.25"></a>
+<span class="sourceLineNo">026</span>import org.apache.commons.fileupload.FileItemFactory;<a name="line.26"></a>
+<span class="sourceLineNo">027</span>import org.apache.commons.fileupload.FileItemIterator;<a name="line.27"></a>
+<span class="sourceLineNo">028</span>import org.apache.commons.fileupload.FileUpload;<a name="line.28"></a>
+<span class="sourceLineNo">029</span>import org.apache.commons.fileupload.FileUploadBase;<a name="line.29"></a>
+<span class="sourceLineNo">030</span>import org.apache.commons.fileupload.FileUploadException;<a name="line.30"></a>
+<span class="sourceLineNo">031</span><a name="line.31"></a>
+<span class="sourceLineNo">032</span>/**<a name="line.32"></a>
+<span class="sourceLineNo">033</span> * &lt;p&gt;High level API for processing file uploads.&lt;/p&gt;<a name="line.33"></a>
+<span class="sourceLineNo">034</span> *<a name="line.34"></a>
+<span class="sourceLineNo">035</span> * &lt;p&gt;This class handles multiple files per single HTML widget, sent using<a name="line.35"></a>
+<span class="sourceLineNo">036</span> * &lt;code&gt;multipart/mixed&lt;/code&gt; encoding type, as specified by<a name="line.36"></a>
+<span class="sourceLineNo">037</span> * &lt;a href="http://www.ietf.org/rfc/rfc1867.txt"&gt;RFC 1867&lt;/a&gt;.  Use<a name="line.37"></a>
+<span class="sourceLineNo">038</span> * {@link org.apache.commons.fileupload.servlet.ServletFileUpload<a name="line.38"></a>
+<span class="sourceLineNo">039</span> * #parseRequest(javax.servlet.http.HttpServletRequest)} to acquire a list<a name="line.39"></a>
+<span class="sourceLineNo">040</span> * of {@link org.apache.commons.fileupload.FileItem FileItems} associated<a name="line.40"></a>
+<span class="sourceLineNo">041</span> * with a given HTML widget.&lt;/p&gt;<a name="line.41"></a>
+<span class="sourceLineNo">042</span> *<a name="line.42"></a>
+<span class="sourceLineNo">043</span> * &lt;p&gt;How the data for individual parts is stored is determined by the factory<a name="line.43"></a>
+<span class="sourceLineNo">044</span> * used to create them; a given part may be in memory, on disk, or somewhere<a name="line.44"></a>
+<span class="sourceLineNo">045</span> * else.&lt;/p&gt;<a name="line.45"></a>
+<span class="sourceLineNo">046</span> *<a name="line.46"></a>
+<span class="sourceLineNo">047</span> * @since FileUpload 1.1<a name="line.47"></a>
+<span class="sourceLineNo">048</span> *<a name="line.48"></a>
+<span class="sourceLineNo">049</span> * @version $Id$<a name="line.49"></a>
+<span class="sourceLineNo">050</span> */<a name="line.50"></a>
+<span class="sourceLineNo">051</span>public class PortletFileUpload extends FileUpload {<a name="line.51"></a>
+<span class="sourceLineNo">052</span><a name="line.52"></a>
+<span class="sourceLineNo">053</span>    // ---------------------------------------------------------- Class methods<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>     * Utility method that determines whether the request contains multipart<a name="line.56"></a>
+<span class="sourceLineNo">057</span>     * content.<a name="line.57"></a>
+<span class="sourceLineNo">058</span>     *<a name="line.58"></a>
+<span class="sourceLineNo">059</span>     * @param request The portlet request to be evaluated. Must be non-null.<a name="line.59"></a>
+<span class="sourceLineNo">060</span>     *<a name="line.60"></a>
+<span class="sourceLineNo">061</span>     * @return &lt;code&gt;true&lt;/code&gt; if the request is multipart;<a name="line.61"></a>
+<span class="sourceLineNo">062</span>     *         &lt;code&gt;false&lt;/code&gt; otherwise.<a name="line.62"></a>
+<span class="sourceLineNo">063</span>     */<a name="line.63"></a>
+<span class="sourceLineNo">064</span>    public static final boolean isMultipartContent(ActionRequest request) {<a name="line.64"></a>
+<span class="sourceLineNo">065</span>        return FileUploadBase.isMultipartContent(<a name="line.65"></a>
+<span class="sourceLineNo">066</span>                new PortletRequestContext(request));<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>    // ----------------------------------------------------------- Constructors<a name="line.69"></a>
+<span class="sourceLineNo">070</span><a name="line.70"></a>
+<span class="sourceLineNo">071</span>    /**<a name="line.71"></a>
+<span class="sourceLineNo">072</span>     * Constructs an uninitialised instance of this class. A factory must be<a name="line.72"></a>
+<span class="sourceLineNo">073</span>     * configured, using &lt;code&gt;setFileItemFactory()&lt;/code&gt;, before attempting<a name="line.73"></a>
+<span class="sourceLineNo">074</span>     * to parse requests.<a name="line.74"></a>
+<span class="sourceLineNo">075</span>     *<a name="line.75"></a>
+<span class="sourceLineNo">076</span>     * @see FileUpload#FileUpload(FileItemFactory)<a name="line.76"></a>
+<span class="sourceLineNo">077</span>     */<a name="line.77"></a>
+<span class="sourceLineNo">078</span>    public PortletFileUpload() {<a name="line.78"></a>
+<span class="sourceLineNo">079</span>        super();<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>    /**<a name="line.82"></a>
+<span class="sourceLineNo">083</span>     * Constructs an instance of this class which uses the supplied factory to<a name="line.83"></a>
+<span class="sourceLineNo">084</span>     * create &lt;code&gt;FileItem&lt;/code&gt; instances.<a name="line.84"></a>
+<span class="sourceLineNo">085</span>     *<a name="line.85"></a>
+<span class="sourceLineNo">086</span>     * @see FileUpload#FileUpload()<a name="line.86"></a>
+<span class="sourceLineNo">087</span>     * @param fileItemFactory The factory to use for creating file items.<a name="line.87"></a>
+<span class="sourceLineNo">088</span>     */<a name="line.88"></a>
+<span class="sourceLineNo">089</span>    public PortletFileUpload(FileItemFactory fileItemFactory) {<a name="line.89"></a>
+<span class="sourceLineNo">090</span>        super(fileItemFactory);<a name="line.90"></a>
+<span class="sourceLineNo">091</span>    }<a name="line.91"></a>
+<span class="sourceLineNo">092</span><a name="line.92"></a>
+<span class="sourceLineNo">093</span>    // --------------------------------------------------------- Public methods<a name="line.93"></a>
+<span class="sourceLineNo">094</span><a name="line.94"></a>
+<span class="sourceLineNo">095</span>    /**<a name="line.95"></a>
+<span class="sourceLineNo">096</span>     * Processes an &lt;a href="http://www.ietf.org/rfc/rfc1867.txt"&gt;RFC 1867&lt;/a&gt;<a name="line.96"></a>
+<span class="sourceLineNo">097</span>     * compliant &lt;code&gt;multipart/form-data&lt;/code&gt; stream.<a name="line.97"></a>
+<span class="sourceLineNo">098</span>     *<a name="line.98"></a>
+<span class="sourceLineNo">099</span>     * @param request The portlet request to be parsed.<a name="line.99"></a>
+<span class="sourceLineNo">100</span>     *<a name="line.100"></a>
+<span class="sourceLineNo">101</span>     * @return A list of &lt;code&gt;FileItem&lt;/code&gt; instances parsed from the<a name="line.101"></a>
+<span class="sourceLineNo">102</span>     *         request, in the order that they were transmitted.<a name="line.102"></a>
+<span class="sourceLineNo">103</span>     *<a name="line.103"></a>
+<span class="sourceLineNo">104</span>     * @throws FileUploadException if there are problems reading/parsing<a name="line.104"></a>
+<span class="sourceLineNo">105</span>     *                             the request or storing files.<a name="line.105"></a>
+<span class="sourceLineNo">106</span>     */<a name="line.106"></a>
+<span class="sourceLineNo">107</span>    public List&lt;FileItem&gt; parseRequest(ActionRequest request)<a name="line.107"></a>
+<span class="sourceLineNo">108</span>            throws FileUploadException {<a name="line.108"></a>
+<span class="sourceLineNo">109</span>        return parseRequest(new PortletRequestContext(request));<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>     * Processes an &lt;a href="http://www.ietf.org/rfc/rfc1867.txt"&gt;RFC 1867&lt;/a&gt;<a name="line.113"></a>
+<span class="sourceLineNo">114</span>     * compliant &lt;code&gt;multipart/form-data&lt;/code&gt; stream.<a name="line.114"></a>
+<span class="sourceLineNo">115</span>     *<a name="line.115"></a>
+<span class="sourceLineNo">116</span>     * @param request The portlet request to be parsed.<a name="line.116"></a>
+<span class="sourceLineNo">117</span>     *<a name="line.117"></a>
+<span class="sourceLineNo">118</span>     * @return A map of &lt;code&gt;FileItem&lt;/code&gt; instances parsed from the request.<a name="line.118"></a>
+<span class="sourceLineNo">119</span>     *<a name="line.119"></a>
+<span class="sourceLineNo">120</span>     * @throws FileUploadException if there are problems reading/parsing<a name="line.120"></a>
+<span class="sourceLineNo">121</span>     *                             the request or storing files.<a name="line.121"></a>
+<span class="sourceLineNo">122</span>     *<a name="line.122"></a>
+<span class="sourceLineNo">123</span>     * @since 1.3<a name="line.123"></a>
+<span class="sourceLineNo">124</span>     */<a name="line.124"></a>
+<span class="sourceLineNo">125</span>    public Map&lt;String, List&lt;FileItem&gt;&gt; parseParameterMap(ActionRequest request)<a name="line.125"></a>
+<span class="sourceLineNo">126</span>            throws FileUploadException {<a name="line.126"></a>
+<span class="sourceLineNo">127</span>        return parseParameterMap(new PortletRequestContext(request));<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>    /**<a name="line.130"></a>
+<span class="sourceLineNo">131</span>     * Processes an &lt;a href="http://www.ietf.org/rfc/rfc1867.txt"&gt;RFC 1867&lt;/a&gt;<a name="line.131"></a>
+<span class="sourceLineNo">132</span>     * compliant &lt;code&gt;multipart/form-data&lt;/code&gt; stream.<a name="line.132"></a>
+<span class="sourceLineNo">133</span>     *<a name="line.133"></a>
+<span class="sourceLineNo">134</span>     * @param request The portlet request to be parsed.<a name="line.134"></a>
+<span class="sourceLineNo">135</span>     *<a name="line.135"></a>
+<span class="sourceLineNo">136</span>     * @return An iterator to instances of &lt;code&gt;FileItemStream&lt;/code&gt;<a name="line.136"></a>
+<span class="sourceLineNo">137</span>     *         parsed from the request, in the order that they were<a name="line.137"></a>
+<span class="sourceLineNo">138</span>     *         transmitted.<a name="line.138"></a>
+<span class="sourceLineNo">139</span>     *<a name="line.139"></a>
+<span class="sourceLineNo">140</span>     * @throws FileUploadException if there are problems reading/parsing<a name="line.140"></a>
+<span class="sourceLineNo">141</span>     *                             the request or storing files.<a name="line.141"></a>
+<span class="sourceLineNo">142</span>     * @throws IOException An I/O error occurred. This may be a network<a name="line.142"></a>
+<span class="sourceLineNo">143</span>     *   error while communicating with the client or a problem while<a name="line.143"></a>
+<span class="sourceLineNo">144</span>     *   storing the uploaded content.<a name="line.144"></a>
+<span class="sourceLineNo">145</span>     */<a name="line.145"></a>
+<span class="sourceLineNo">146</span>    public FileItemIterator getItemIterator(ActionRequest request)<a name="line.146"></a>
+<span class="sourceLineNo">147</span>            throws FileUploadException, IOException {<a name="line.147"></a>
+<span class="sourceLineNo">148</span>        return super.getItemIterator(new PortletRequestContext(request));<a name="line.148"></a>
+<span class="sourceLineNo">149</span>    }<a name="line.149"></a>
+<span class="sourceLineNo">150</span><a name="line.150"></a>
+<span class="sourceLineNo">151</span>}<a name="line.151"></a>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+</pre>
+</div>
+</body>
+</html>

Added: websites/production/commons/content/proper/commons-fileupload/javadocs/api-release/src-html/org/apache/commons/fileupload/portlet/PortletRequestContext.html
==============================================================================
--- websites/production/commons/content/proper/commons-fileupload/javadocs/api-release/src-html/org/apache/commons/fileupload/portlet/PortletRequestContext.html (added)
+++ websites/production/commons/content/proper/commons-fileupload/javadocs/api-release/src-html/org/apache/commons/fileupload/portlet/PortletRequestContext.html Tue Jun 13 12:48:38 2017
@@ -0,0 +1,201 @@
+<!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.fileupload.portlet;<a name="line.17"></a>
+<span class="sourceLineNo">018</span><a name="line.18"></a>
+<span class="sourceLineNo">019</span>import static java.lang.String.format;<a name="line.19"></a>
+<span class="sourceLineNo">020</span><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.io.InputStream;<a name="line.22"></a>
+<span class="sourceLineNo">023</span><a name="line.23"></a>
+<span class="sourceLineNo">024</span>import javax.portlet.ActionRequest;<a name="line.24"></a>
+<span class="sourceLineNo">025</span><a name="line.25"></a>
+<span class="sourceLineNo">026</span>import org.apache.commons.fileupload.FileUploadBase;<a name="line.26"></a>
+<span class="sourceLineNo">027</span>import org.apache.commons.fileupload.UploadContext;<a name="line.27"></a>
+<span class="sourceLineNo">028</span><a name="line.28"></a>
+<span class="sourceLineNo">029</span>/**<a name="line.29"></a>
+<span class="sourceLineNo">030</span> * &lt;p&gt;Provides access to the request information needed for a request made to<a name="line.30"></a>
+<span class="sourceLineNo">031</span> * a portlet.&lt;/p&gt;<a name="line.31"></a>
+<span class="sourceLineNo">032</span> *<a name="line.32"></a>
+<span class="sourceLineNo">033</span> * @since FileUpload 1.1<a name="line.33"></a>
+<span class="sourceLineNo">034</span> *<a name="line.34"></a>
+<span class="sourceLineNo">035</span> * @version $Id$<a name="line.35"></a>
+<span class="sourceLineNo">036</span> */<a name="line.36"></a>
+<span class="sourceLineNo">037</span>public class PortletRequestContext implements UploadContext {<a name="line.37"></a>
+<span class="sourceLineNo">038</span><a name="line.38"></a>
+<span class="sourceLineNo">039</span>    // ----------------------------------------------------- Instance Variables<a name="line.39"></a>
+<span class="sourceLineNo">040</span><a name="line.40"></a>
+<span class="sourceLineNo">041</span>    /**<a name="line.41"></a>
+<span class="sourceLineNo">042</span>     * The request for which the context is being provided.<a name="line.42"></a>
+<span class="sourceLineNo">043</span>     */<a name="line.43"></a>
+<span class="sourceLineNo">044</span>    private final ActionRequest request;<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>    // ----------------------------------------------------------- Constructors<a name="line.47"></a>
+<span class="sourceLineNo">048</span><a name="line.48"></a>
+<span class="sourceLineNo">049</span>    /**<a name="line.49"></a>
+<span class="sourceLineNo">050</span>     * Construct a context for this request.<a name="line.50"></a>
+<span class="sourceLineNo">051</span>     *<a name="line.51"></a>
+<span class="sourceLineNo">052</span>     * @param request The request to which this context applies.<a name="line.52"></a>
+<span class="sourceLineNo">053</span>     */<a name="line.53"></a>
+<span class="sourceLineNo">054</span>    public PortletRequestContext(ActionRequest request) {<a name="line.54"></a>
+<span class="sourceLineNo">055</span>        this.request = request;<a name="line.55"></a>
+<span class="sourceLineNo">056</span>    }<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>    // --------------------------------------------------------- Public Methods<a name="line.59"></a>
+<span class="sourceLineNo">060</span><a name="line.60"></a>
+<span class="sourceLineNo">061</span>    /**<a name="line.61"></a>
+<span class="sourceLineNo">062</span>     * Retrieve the character encoding for the request.<a name="line.62"></a>
+<span class="sourceLineNo">063</span>     *<a name="line.63"></a>
+<span class="sourceLineNo">064</span>     * @return The character encoding for the request.<a name="line.64"></a>
+<span class="sourceLineNo">065</span>     */<a name="line.65"></a>
+<span class="sourceLineNo">066</span>    public String getCharacterEncoding() {<a name="line.66"></a>
+<span class="sourceLineNo">067</span>        return request.getCharacterEncoding();<a name="line.67"></a>
+<span class="sourceLineNo">068</span>    }<a name="line.68"></a>
+<span class="sourceLineNo">069</span><a name="line.69"></a>
+<span class="sourceLineNo">070</span>    /**<a name="line.70"></a>
+<span class="sourceLineNo">071</span>     * Retrieve the content type of the request.<a name="line.71"></a>
+<span class="sourceLineNo">072</span>     *<a name="line.72"></a>
+<span class="sourceLineNo">073</span>     * @return The content type of the request.<a name="line.73"></a>
+<span class="sourceLineNo">074</span>     */<a name="line.74"></a>
+<span class="sourceLineNo">075</span>    public String getContentType() {<a name="line.75"></a>
+<span class="sourceLineNo">076</span>        return request.getContentType();<a name="line.76"></a>
+<span class="sourceLineNo">077</span>    }<a name="line.77"></a>
+<span class="sourceLineNo">078</span><a name="line.78"></a>
+<span class="sourceLineNo">079</span>    /**<a name="line.79"></a>
+<span class="sourceLineNo">080</span>     * Retrieve the content length of the request.<a name="line.80"></a>
+<span class="sourceLineNo">081</span>     *<a name="line.81"></a>
+<span class="sourceLineNo">082</span>     * @return The content length of the request.<a name="line.82"></a>
+<span class="sourceLineNo">083</span>     * @deprecated 1.3 Use {@link #contentLength()} instead<a name="line.83"></a>
+<span class="sourceLineNo">084</span>     */<a name="line.84"></a>
+<span class="sourceLineNo">085</span>    @Deprecated<a name="line.85"></a>
+<span class="sourceLineNo">086</span>    public int getContentLength() {<a name="line.86"></a>
+<span class="sourceLineNo">087</span>        return request.getContentLength();<a name="line.87"></a>
+<span class="sourceLineNo">088</span>    }<a name="line.88"></a>
+<span class="sourceLineNo">089</span><a name="line.89"></a>
+<span class="sourceLineNo">090</span>    /**<a name="line.90"></a>
+<span class="sourceLineNo">091</span>     * Retrieve the content length of the request.<a name="line.91"></a>
+<span class="sourceLineNo">092</span>     *<a name="line.92"></a>
+<span class="sourceLineNo">093</span>     * @return The content length of the request.<a name="line.93"></a>
+<span class="sourceLineNo">094</span>     * @since 1.3<a name="line.94"></a>
+<span class="sourceLineNo">095</span>     */<a name="line.95"></a>
+<span class="sourceLineNo">096</span>    public long contentLength() {<a name="line.96"></a>
+<span class="sourceLineNo">097</span>        long size;<a name="line.97"></a>
+<span class="sourceLineNo">098</span>        try {<a name="line.98"></a>
+<span class="sourceLineNo">099</span>            size = Long.parseLong(request.getProperty(FileUploadBase.CONTENT_LENGTH));<a name="line.99"></a>
+<span class="sourceLineNo">100</span>        } catch (NumberFormatException e) {<a name="line.100"></a>
+<span class="sourceLineNo">101</span>            size = request.getContentLength();<a name="line.101"></a>
+<span class="sourceLineNo">102</span>        }<a name="line.102"></a>
+<span class="sourceLineNo">103</span>        return size;<a name="line.103"></a>
+<span class="sourceLineNo">104</span>    }<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>
+<span class="sourceLineNo">107</span>     * Retrieve the input stream for the request.<a name="line.107"></a>
+<span class="sourceLineNo">108</span>     *<a name="line.108"></a>
+<span class="sourceLineNo">109</span>     * @return The input stream for the request.<a name="line.109"></a>
+<span class="sourceLineNo">110</span>     *<a name="line.110"></a>
+<span class="sourceLineNo">111</span>     * @throws IOException if a problem occurs.<a name="line.111"></a>
+<span class="sourceLineNo">112</span>     */<a name="line.112"></a>
+<span class="sourceLineNo">113</span>    public InputStream getInputStream() throws IOException {<a name="line.113"></a>
+<span class="sourceLineNo">114</span>        return request.getPortletInputStream();<a name="line.114"></a>
+<span class="sourceLineNo">115</span>    }<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>     * Returns a string representation of this object.<a name="line.118"></a>
+<span class="sourceLineNo">119</span>     *<a name="line.119"></a>
+<span class="sourceLineNo">120</span>     * @return a string representation of this object.<a name="line.120"></a>
+<span class="sourceLineNo">121</span>     */<a name="line.121"></a>
+<span class="sourceLineNo">122</span>    @Override<a name="line.122"></a>
+<span class="sourceLineNo">123</span>    public String toString() {<a name="line.123"></a>
+<span class="sourceLineNo">124</span>        return format("ContentLength=%s, ContentType=%s",<a name="line.124"></a>
+<span class="sourceLineNo">125</span>                      Long.valueOf(this.contentLength()),<a name="line.125"></a>
+<span class="sourceLineNo">126</span>                      this.getContentType());<a name="line.126"></a>
+<span class="sourceLineNo">127</span>    }<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>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+</pre>
+</div>
+</body>
+</html>

Added: websites/production/commons/content/proper/commons-fileupload/javadocs/api-release/src-html/org/apache/commons/fileupload/servlet/FileCleanerCleanup.html
==============================================================================
--- websites/production/commons/content/proper/commons-fileupload/javadocs/api-release/src-html/org/apache/commons/fileupload/servlet/FileCleanerCleanup.html (added)
+++ websites/production/commons/content/proper/commons-fileupload/javadocs/api-release/src-html/org/apache/commons/fileupload/servlet/FileCleanerCleanup.html Tue Jun 13 12:48:38 2017
@@ -0,0 +1,161 @@
+<!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.fileupload.servlet;<a name="line.17"></a>
+<span class="sourceLineNo">018</span><a name="line.18"></a>
+<span class="sourceLineNo">019</span>import javax.servlet.ServletContext;<a name="line.19"></a>
+<span class="sourceLineNo">020</span>import javax.servlet.ServletContextListener;<a name="line.20"></a>
+<span class="sourceLineNo">021</span>import javax.servlet.ServletContextEvent;<a name="line.21"></a>
+<span class="sourceLineNo">022</span><a name="line.22"></a>
+<span class="sourceLineNo">023</span>import org.apache.commons.io.FileCleaningTracker;<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> * A servlet context listener, which ensures that the<a name="line.26"></a>
+<span class="sourceLineNo">027</span> * {@link FileCleaningTracker}'s reaper thread is terminated,<a name="line.27"></a>
+<span class="sourceLineNo">028</span> * when the web application is destroyed.<a name="line.28"></a>
+<span class="sourceLineNo">029</span> *<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 FileCleanerCleanup implements ServletContextListener {<a name="line.32"></a>
+<span class="sourceLineNo">033</span><a name="line.33"></a>
+<span class="sourceLineNo">034</span>    /**<a name="line.34"></a>
+<span class="sourceLineNo">035</span>     * Attribute name, which is used for storing an instance of<a name="line.35"></a>
+<span class="sourceLineNo">036</span>     * {@link FileCleaningTracker} in the web application.<a name="line.36"></a>
+<span class="sourceLineNo">037</span>     */<a name="line.37"></a>
+<span class="sourceLineNo">038</span>    public static final String FILE_CLEANING_TRACKER_ATTRIBUTE<a name="line.38"></a>
+<span class="sourceLineNo">039</span>        = FileCleanerCleanup.class.getName() + ".FileCleaningTracker";<a name="line.39"></a>
+<span class="sourceLineNo">040</span><a name="line.40"></a>
+<span class="sourceLineNo">041</span>    /**<a name="line.41"></a>
+<span class="sourceLineNo">042</span>     * Returns the instance of {@link FileCleaningTracker}, which is<a name="line.42"></a>
+<span class="sourceLineNo">043</span>     * associated with the given {@link ServletContext}.<a name="line.43"></a>
+<span class="sourceLineNo">044</span>     *<a name="line.44"></a>
+<span class="sourceLineNo">045</span>     * @param pServletContext The servlet context to query<a name="line.45"></a>
+<span class="sourceLineNo">046</span>     * @return The contexts tracker<a name="line.46"></a>
+<span class="sourceLineNo">047</span>     */<a name="line.47"></a>
+<span class="sourceLineNo">048</span>    public static FileCleaningTracker<a name="line.48"></a>
+<span class="sourceLineNo">049</span>            getFileCleaningTracker(ServletContext pServletContext) {<a name="line.49"></a>
+<span class="sourceLineNo">050</span>        return (FileCleaningTracker)<a name="line.50"></a>
+<span class="sourceLineNo">051</span>            pServletContext.getAttribute(FILE_CLEANING_TRACKER_ATTRIBUTE);<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>     * Sets the instance of {@link FileCleaningTracker}, which is<a name="line.55"></a>
+<span class="sourceLineNo">056</span>     * associated with the given {@link ServletContext}.<a name="line.56"></a>
+<span class="sourceLineNo">057</span>     *<a name="line.57"></a>
+<span class="sourceLineNo">058</span>     * @param pServletContext The servlet context to modify<a name="line.58"></a>
+<span class="sourceLineNo">059</span>     * @param pTracker The tracker to set<a name="line.59"></a>
+<span class="sourceLineNo">060</span>     */<a name="line.60"></a>
+<span class="sourceLineNo">061</span>    public static void setFileCleaningTracker(ServletContext pServletContext,<a name="line.61"></a>
+<span class="sourceLineNo">062</span>            FileCleaningTracker pTracker) {<a name="line.62"></a>
+<span class="sourceLineNo">063</span>        pServletContext.setAttribute(FILE_CLEANING_TRACKER_ATTRIBUTE, pTracker);<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>     * Called when the web application is initialized. Does<a name="line.67"></a>
+<span class="sourceLineNo">068</span>     * nothing.<a name="line.68"></a>
+<span class="sourceLineNo">069</span>     *<a name="line.69"></a>
+<span class="sourceLineNo">070</span>     * @param sce The servlet context, used for calling<a name="line.70"></a>
+<span class="sourceLineNo">071</span>     *   {@link #setFileCleaningTracker(ServletContext, FileCleaningTracker)}.<a name="line.71"></a>
+<span class="sourceLineNo">072</span>     */<a name="line.72"></a>
+<span class="sourceLineNo">073</span>    public void contextInitialized(ServletContextEvent sce) {<a name="line.73"></a>
+<span class="sourceLineNo">074</span>        setFileCleaningTracker(sce.getServletContext(),<a name="line.74"></a>
+<span class="sourceLineNo">075</span>                new FileCleaningTracker());<a name="line.75"></a>
+<span class="sourceLineNo">076</span>    }<a name="line.76"></a>
+<span class="sourceLineNo">077</span><a name="line.77"></a>
+<span class="sourceLineNo">078</span>    /**<a name="line.78"></a>
+<span class="sourceLineNo">079</span>     * Called when the web application is being destroyed.<a name="line.79"></a>
+<span class="sourceLineNo">080</span>     * Calls {@link FileCleaningTracker#exitWhenFinished()}.<a name="line.80"></a>
+<span class="sourceLineNo">081</span>     *<a name="line.81"></a>
+<span class="sourceLineNo">082</span>     * @param sce The servlet context, used for calling<a name="line.82"></a>
+<span class="sourceLineNo">083</span>     *     {@link #getFileCleaningTracker(ServletContext)}.<a name="line.83"></a>
+<span class="sourceLineNo">084</span>     */<a name="line.84"></a>
+<span class="sourceLineNo">085</span>    public void contextDestroyed(ServletContextEvent sce) {<a name="line.85"></a>
+<span class="sourceLineNo">086</span>        getFileCleaningTracker(sce.getServletContext()).exitWhenFinished();<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>}<a name="line.89"></a>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+</pre>
+</div>
+</body>
+</html>

Added: websites/production/commons/content/proper/commons-fileupload/javadocs/api-release/src-html/org/apache/commons/fileupload/servlet/ServletFileUpload.html
==============================================================================
--- websites/production/commons/content/proper/commons-fileupload/javadocs/api-release/src-html/org/apache/commons/fileupload/servlet/ServletFileUpload.html (added)
+++ websites/production/commons/content/proper/commons-fileupload/javadocs/api-release/src-html/org/apache/commons/fileupload/servlet/ServletFileUpload.html Tue Jun 13 12:48:38 2017
@@ -0,0 +1,229 @@
+<!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.fileupload.servlet;<a name="line.17"></a>
+<span class="sourceLineNo">018</span><a name="line.18"></a>
+<span class="sourceLineNo">019</span>import java.io.IOException;<a name="line.19"></a>
+<span class="sourceLineNo">020</span>import java.util.List;<a name="line.20"></a>
+<span class="sourceLineNo">021</span>import java.util.Map;<a name="line.21"></a>
+<span class="sourceLineNo">022</span><a name="line.22"></a>
+<span class="sourceLineNo">023</span>import javax.servlet.http.HttpServletRequest;<a name="line.23"></a>
+<span class="sourceLineNo">024</span><a name="line.24"></a>
+<span class="sourceLineNo">025</span>import org.apache.commons.fileupload.FileItem;<a name="line.25"></a>
+<span class="sourceLineNo">026</span>import org.apache.commons.fileupload.FileItemFactory;<a name="line.26"></a>
+<span class="sourceLineNo">027</span>import org.apache.commons.fileupload.FileItemIterator;<a name="line.27"></a>
+<span class="sourceLineNo">028</span>import org.apache.commons.fileupload.FileUpload;<a name="line.28"></a>
+<span class="sourceLineNo">029</span>import org.apache.commons.fileupload.FileUploadBase;<a name="line.29"></a>
+<span class="sourceLineNo">030</span>import org.apache.commons.fileupload.FileUploadException;<a name="line.30"></a>
+<span class="sourceLineNo">031</span><a name="line.31"></a>
+<span class="sourceLineNo">032</span>/**<a name="line.32"></a>
+<span class="sourceLineNo">033</span> * &lt;p&gt;High level API for processing file uploads.&lt;/p&gt;<a name="line.33"></a>
+<span class="sourceLineNo">034</span> *<a name="line.34"></a>
+<span class="sourceLineNo">035</span> * &lt;p&gt;This class handles multiple files per single HTML widget, sent using<a name="line.35"></a>
+<span class="sourceLineNo">036</span> * &lt;code&gt;multipart/mixed&lt;/code&gt; encoding type, as specified by<a name="line.36"></a>
+<span class="sourceLineNo">037</span> * &lt;a href="http://www.ietf.org/rfc/rfc1867.txt"&gt;RFC 1867&lt;/a&gt;.  Use {@link<a name="line.37"></a>
+<span class="sourceLineNo">038</span> * #parseRequest(HttpServletRequest)} to acquire a list of {@link<a name="line.38"></a>
+<span class="sourceLineNo">039</span> * org.apache.commons.fileupload.FileItem}s associated with a given HTML<a name="line.39"></a>
+<span class="sourceLineNo">040</span> * widget.&lt;/p&gt;<a name="line.40"></a>
+<span class="sourceLineNo">041</span> *<a name="line.41"></a>
+<span class="sourceLineNo">042</span> * &lt;p&gt;How the data for individual parts is stored is determined by the factory<a name="line.42"></a>
+<span class="sourceLineNo">043</span> * used to create them; a given part may be in memory, on disk, or somewhere<a name="line.43"></a>
+<span class="sourceLineNo">044</span> * else.&lt;/p&gt;<a name="line.44"></a>
+<span class="sourceLineNo">045</span> *<a name="line.45"></a>
+<span class="sourceLineNo">046</span> * @version $Id$<a name="line.46"></a>
+<span class="sourceLineNo">047</span> */<a name="line.47"></a>
+<span class="sourceLineNo">048</span>public class ServletFileUpload extends FileUpload {<a name="line.48"></a>
+<span class="sourceLineNo">049</span><a name="line.49"></a>
+<span class="sourceLineNo">050</span>    /**<a name="line.50"></a>
+<span class="sourceLineNo">051</span>     * Constant for HTTP POST method.<a name="line.51"></a>
+<span class="sourceLineNo">052</span>     */<a name="line.52"></a>
+<span class="sourceLineNo">053</span>    private static final String POST_METHOD = "POST";<a name="line.53"></a>
+<span class="sourceLineNo">054</span><a name="line.54"></a>
+<span class="sourceLineNo">055</span>    // ---------------------------------------------------------- Class methods<a name="line.55"></a>
+<span class="sourceLineNo">056</span><a name="line.56"></a>
+<span class="sourceLineNo">057</span>    /**<a name="line.57"></a>
+<span class="sourceLineNo">058</span>     * Utility method that determines whether the request contains multipart<a name="line.58"></a>
+<span class="sourceLineNo">059</span>     * content.<a name="line.59"></a>
+<span class="sourceLineNo">060</span>     *<a name="line.60"></a>
+<span class="sourceLineNo">061</span>     * @param request The servlet request to be evaluated. Must be non-null.<a name="line.61"></a>
+<span class="sourceLineNo">062</span>     *<a name="line.62"></a>
+<span class="sourceLineNo">063</span>     * @return &lt;code&gt;true&lt;/code&gt; if the request is multipart;<a name="line.63"></a>
+<span class="sourceLineNo">064</span>     *         &lt;code&gt;false&lt;/code&gt; otherwise.<a name="line.64"></a>
+<span class="sourceLineNo">065</span>     */<a name="line.65"></a>
+<span class="sourceLineNo">066</span>    public static final boolean isMultipartContent(<a name="line.66"></a>
+<span class="sourceLineNo">067</span>            HttpServletRequest request) {<a name="line.67"></a>
+<span class="sourceLineNo">068</span>        if (!POST_METHOD.equalsIgnoreCase(request.getMethod())) {<a name="line.68"></a>
+<span class="sourceLineNo">069</span>            return false;<a name="line.69"></a>
+<span class="sourceLineNo">070</span>        }<a name="line.70"></a>
+<span class="sourceLineNo">071</span>        return FileUploadBase.isMultipartContent(new ServletRequestContext(request));<a name="line.71"></a>
+<span class="sourceLineNo">072</span>    }<a name="line.72"></a>
+<span class="sourceLineNo">073</span><a name="line.73"></a>
+<span class="sourceLineNo">074</span>    // ----------------------------------------------------------- Constructors<a name="line.74"></a>
+<span class="sourceLineNo">075</span><a name="line.75"></a>
+<span class="sourceLineNo">076</span>    /**<a name="line.76"></a>
+<span class="sourceLineNo">077</span>     * Constructs an uninitialised instance of this class. A factory must be<a name="line.77"></a>
+<span class="sourceLineNo">078</span>     * configured, using &lt;code&gt;setFileItemFactory()&lt;/code&gt;, before attempting<a name="line.78"></a>
+<span class="sourceLineNo">079</span>     * to parse requests.<a name="line.79"></a>
+<span class="sourceLineNo">080</span>     *<a name="line.80"></a>
+<span class="sourceLineNo">081</span>     * @see FileUpload#FileUpload(FileItemFactory)<a name="line.81"></a>
+<span class="sourceLineNo">082</span>     */<a name="line.82"></a>
+<span class="sourceLineNo">083</span>    public ServletFileUpload() {<a name="line.83"></a>
+<span class="sourceLineNo">084</span>        super();<a name="line.84"></a>
+<span class="sourceLineNo">085</span>    }<a name="line.85"></a>
+<span class="sourceLineNo">086</span><a name="line.86"></a>
+<span class="sourceLineNo">087</span>    /**<a name="line.87"></a>
+<span class="sourceLineNo">088</span>     * Constructs an instance of this class which uses the supplied factory to<a name="line.88"></a>
+<span class="sourceLineNo">089</span>     * create &lt;code&gt;FileItem&lt;/code&gt; instances.<a name="line.89"></a>
+<span class="sourceLineNo">090</span>     *<a name="line.90"></a>
+<span class="sourceLineNo">091</span>     * @see FileUpload#FileUpload()<a name="line.91"></a>
+<span class="sourceLineNo">092</span>     * @param fileItemFactory The factory to use for creating file items.<a name="line.92"></a>
+<span class="sourceLineNo">093</span>     */<a name="line.93"></a>
+<span class="sourceLineNo">094</span>    public ServletFileUpload(FileItemFactory fileItemFactory) {<a name="line.94"></a>
+<span class="sourceLineNo">095</span>        super(fileItemFactory);<a name="line.95"></a>
+<span class="sourceLineNo">096</span>    }<a name="line.96"></a>
+<span class="sourceLineNo">097</span><a name="line.97"></a>
+<span class="sourceLineNo">098</span>    // --------------------------------------------------------- Public methods<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>     * Processes an &lt;a href="http://www.ietf.org/rfc/rfc1867.txt"&gt;RFC 1867&lt;/a&gt;<a name="line.101"></a>
+<span class="sourceLineNo">102</span>     * compliant &lt;code&gt;multipart/form-data&lt;/code&gt; stream.<a name="line.102"></a>
+<span class="sourceLineNo">103</span>     *<a name="line.103"></a>
+<span class="sourceLineNo">104</span>     * @param request The servlet request to be parsed.<a name="line.104"></a>
+<span class="sourceLineNo">105</span>     *<a name="line.105"></a>
+<span class="sourceLineNo">106</span>     * @return A list of &lt;code&gt;FileItem&lt;/code&gt; instances parsed from the<a name="line.106"></a>
+<span class="sourceLineNo">107</span>     *         request, in the order that they were transmitted.<a name="line.107"></a>
+<span class="sourceLineNo">108</span>     *<a name="line.108"></a>
+<span class="sourceLineNo">109</span>     * @throws FileUploadException if there are problems reading/parsing<a name="line.109"></a>
+<span class="sourceLineNo">110</span>     *                             the request or storing files.<a name="line.110"></a>
+<span class="sourceLineNo">111</span>     */<a name="line.111"></a>
+<span class="sourceLineNo">112</span>    @Override<a name="line.112"></a>
+<span class="sourceLineNo">113</span>    public List&lt;FileItem&gt; parseRequest(HttpServletRequest request)<a name="line.113"></a>
+<span class="sourceLineNo">114</span>    throws FileUploadException {<a name="line.114"></a>
+<span class="sourceLineNo">115</span>        return parseRequest(new ServletRequestContext(request));<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>    /**<a name="line.118"></a>
+<span class="sourceLineNo">119</span>     * Processes an &lt;a href="http://www.ietf.org/rfc/rfc1867.txt"&gt;RFC 1867&lt;/a&gt;<a name="line.119"></a>
+<span class="sourceLineNo">120</span>     * compliant &lt;code&gt;multipart/form-data&lt;/code&gt; stream.<a name="line.120"></a>
+<span class="sourceLineNo">121</span>     *<a name="line.121"></a>
+<span class="sourceLineNo">122</span>     * @param request The servlet request to be parsed.<a name="line.122"></a>
+<span class="sourceLineNo">123</span>     *<a name="line.123"></a>
+<span class="sourceLineNo">124</span>     * @return A map of &lt;code&gt;FileItem&lt;/code&gt; instances parsed from the request.<a name="line.124"></a>
+<span class="sourceLineNo">125</span>     *<a name="line.125"></a>
+<span class="sourceLineNo">126</span>     * @throws FileUploadException if there are problems reading/parsing<a name="line.126"></a>
+<span class="sourceLineNo">127</span>     *                             the request or storing files.<a name="line.127"></a>
+<span class="sourceLineNo">128</span>     *<a name="line.128"></a>
+<span class="sourceLineNo">129</span>     * @since 1.3<a name="line.129"></a>
+<span class="sourceLineNo">130</span>     */<a name="line.130"></a>
+<span class="sourceLineNo">131</span>    public Map&lt;String, List&lt;FileItem&gt;&gt; parseParameterMap(HttpServletRequest request)<a name="line.131"></a>
+<span class="sourceLineNo">132</span>            throws FileUploadException {<a name="line.132"></a>
+<span class="sourceLineNo">133</span>        return parseParameterMap(new ServletRequestContext(request));<a name="line.133"></a>
+<span class="sourceLineNo">134</span>    }<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>
+<span class="sourceLineNo">137</span>     * Processes an &lt;a href="http://www.ietf.org/rfc/rfc1867.txt"&gt;RFC 1867&lt;/a&gt;<a name="line.137"></a>
+<span class="sourceLineNo">138</span>     * compliant &lt;code&gt;multipart/form-data&lt;/code&gt; stream.<a name="line.138"></a>
+<span class="sourceLineNo">139</span>     *<a name="line.139"></a>
+<span class="sourceLineNo">140</span>     * @param request The servlet request to be parsed.<a name="line.140"></a>
+<span class="sourceLineNo">141</span>     *<a name="line.141"></a>
+<span class="sourceLineNo">142</span>     * @return An iterator to instances of &lt;code&gt;FileItemStream&lt;/code&gt;<a name="line.142"></a>
+<span class="sourceLineNo">143</span>     *         parsed from the request, in the order that they were<a name="line.143"></a>
+<span class="sourceLineNo">144</span>     *         transmitted.<a name="line.144"></a>
+<span class="sourceLineNo">145</span>     *<a name="line.145"></a>
+<span class="sourceLineNo">146</span>     * @throws FileUploadException if there are problems reading/parsing<a name="line.146"></a>
+<span class="sourceLineNo">147</span>     *                             the request or storing files.<a name="line.147"></a>
+<span class="sourceLineNo">148</span>     * @throws IOException An I/O error occurred. This may be a network<a name="line.148"></a>
+<span class="sourceLineNo">149</span>     *   error while communicating with the client or a problem while<a name="line.149"></a>
+<span class="sourceLineNo">150</span>     *   storing the uploaded content.<a name="line.150"></a>
+<span class="sourceLineNo">151</span>     */<a name="line.151"></a>
+<span class="sourceLineNo">152</span>    public FileItemIterator getItemIterator(HttpServletRequest request)<a name="line.152"></a>
+<span class="sourceLineNo">153</span>    throws FileUploadException, IOException {<a name="line.153"></a>
+<span class="sourceLineNo">154</span>        return super.getItemIterator(new ServletRequestContext(request));<a name="line.154"></a>
+<span class="sourceLineNo">155</span>    }<a name="line.155"></a>
+<span class="sourceLineNo">156</span><a name="line.156"></a>
+<span class="sourceLineNo">157</span>}<a name="line.157"></a>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+</pre>
+</div>
+</body>
+</html>



Mime
View raw message