FAISP/libs/commons-fileupload-1.4-bin/apidocs/org/apache/commons/fileupload/package-summary.html

429 lines
21 KiB
HTML

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<!-- NewPage -->
<html lang="en">
<head>
<!-- Generated by javadoc -->
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<title>org.apache.commons.fileupload (Apache Commons FileUpload 1.4 API)</title>
<link rel="stylesheet" type="text/css" href="../../../../stylesheet.css" title="Style">
<script type="text/javascript" src="../../../../script.js"></script>
</head>
<body>
<script type="text/javascript"><!--
try {
if (location.href.indexOf('is-external=true') == -1) {
parent.document.title="org.apache.commons.fileupload (Apache Commons FileUpload 1.4 API)";
}
}
catch(err) {
}
//-->
</script>
<noscript>
<div>JavaScript is disabled on your browser.</div>
</noscript>
<!-- ========= START OF TOP NAVBAR ======= -->
<div class="topNav"><a name="navbar.top">
<!-- -->
</a>
<div class="skipNav"><a href="#skip.navbar.top" title="Skip navigation links">Skip navigation links</a></div>
<a name="navbar.top.firstrow">
<!-- -->
</a>
<ul class="navList" title="Navigation">
<li><a href="../../../../overview-summary.html">Overview</a></li>
<li class="navBarCell1Rev">Package</li>
<li>Class</li>
<li><a href="package-use.html">Use</a></li>
<li><a href="package-tree.html">Tree</a></li>
<li><a href="../../../../deprecated-list.html">Deprecated</a></li>
<li><a href="../../../../index-all.html">Index</a></li>
<li><a href="../../../../help-doc.html">Help</a></li>
</ul>
</div>
<div class="subNav">
<ul class="navList">
<li>Prev&nbsp;Package</li>
<li><a href="../../../../org/apache/commons/fileupload/disk/package-summary.html">Next&nbsp;Package</a></li>
</ul>
<ul class="navList">
<li><a href="../../../../index.html?org/apache/commons/fileupload/package-summary.html" target="_top">Frames</a></li>
<li><a href="package-summary.html" target="_top">No&nbsp;Frames</a></li>
</ul>
<ul class="navList" id="allclasses_navbar_top">
<li><a href="../../../../allclasses-noframe.html">All&nbsp;Classes</a></li>
</ul>
<div>
<script type="text/javascript"><!--
allClassesLink = document.getElementById("allclasses_navbar_top");
if(window==top) {
allClassesLink.style.display = "block";
}
else {
allClassesLink.style.display = "none";
}
//-->
</script>
</div>
<a name="skip.navbar.top">
<!-- -->
</a></div>
<!-- ========= END OF TOP NAVBAR ========= -->
<div class="header">
<h1 title="Package" class="title">Package&nbsp;org.apache.commons.fileupload</h1>
<div class="docSummary">
<div class="block">
A component for handling HTML file uploads as specified by
<a href="http://www.ietf.org/rfc/rfc1867.txt" target="_top">RFC&nbsp;1867</a>.</div>
</div>
<p>See:&nbsp;<a href="#package.description">Description</a></p>
</div>
<div class="contentContainer">
<ul class="blockList">
<li class="blockList">
<table class="typeSummary" border="0" cellpadding="3" cellspacing="0" summary="Interface Summary table, listing interfaces, and an explanation">
<caption><span>Interface Summary</span><span class="tabEnd">&nbsp;</span></caption>
<tr>
<th class="colFirst" scope="col">Interface</th>
<th class="colLast" scope="col">Description</th>
</tr>
<tbody>
<tr class="altColor">
<td class="colFirst"><a href="../../../../org/apache/commons/fileupload/FileItem.html" title="interface in org.apache.commons.fileupload">FileItem</a></td>
<td class="colLast">
<div class="block"> This class represents a file or form item that was received within a
<code>multipart/form-data</code> POST request.</div>
</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><a href="../../../../org/apache/commons/fileupload/FileItemFactory.html" title="interface in org.apache.commons.fileupload">FileItemFactory</a></td>
<td class="colLast">
<div class="block">A factory interface for creating <a href="../../../../org/apache/commons/fileupload/FileItem.html" title="interface in org.apache.commons.fileupload"><code>FileItem</code></a> instances.</div>
</td>
</tr>
<tr class="altColor">
<td class="colFirst"><a href="../../../../org/apache/commons/fileupload/FileItemHeaders.html" title="interface in org.apache.commons.fileupload">FileItemHeaders</a></td>
<td class="colLast">
<div class="block"> This class provides support for accessing the headers for a file or form
item that was received within a <code>multipart/form-data</code> POST
request.</div>
</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><a href="../../../../org/apache/commons/fileupload/FileItemHeadersSupport.html" title="interface in org.apache.commons.fileupload">FileItemHeadersSupport</a></td>
<td class="colLast">
<div class="block">Interface that will indicate that <a href="../../../../org/apache/commons/fileupload/FileItem.html" title="interface in org.apache.commons.fileupload"><code>FileItem</code></a> or <a href="../../../../org/apache/commons/fileupload/FileItemStream.html" title="interface in org.apache.commons.fileupload"><code>FileItemStream</code></a>
implementations will accept the headers read for the item.</div>
</td>
</tr>
<tr class="altColor">
<td class="colFirst"><a href="../../../../org/apache/commons/fileupload/FileItemIterator.html" title="interface in org.apache.commons.fileupload">FileItemIterator</a></td>
<td class="colLast">
<div class="block">An iterator, as returned by
<a href="../../../../org/apache/commons/fileupload/FileUploadBase.html#getItemIterator-org.apache.commons.fileupload.RequestContext-"><code>FileUploadBase.getItemIterator(RequestContext)</code></a>.</div>
</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><a href="../../../../org/apache/commons/fileupload/FileItemStream.html" title="interface in org.apache.commons.fileupload">FileItemStream</a></td>
<td class="colLast">
<div class="block"> This interface provides access to a file or form item that was
received within a <code>multipart/form-data</code> POST request.</div>
</td>
</tr>
<tr class="altColor">
<td class="colFirst"><a href="../../../../org/apache/commons/fileupload/ProgressListener.html" title="interface in org.apache.commons.fileupload">ProgressListener</a></td>
<td class="colLast">
<div class="block">The <a href="../../../../org/apache/commons/fileupload/ProgressListener.html" title="interface in org.apache.commons.fileupload"><code>ProgressListener</code></a> may be used to display a progress bar
or do stuff like that.</div>
</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><a href="../../../../org/apache/commons/fileupload/RequestContext.html" title="interface in org.apache.commons.fileupload">RequestContext</a></td>
<td class="colLast">
<div class="block">Abstracts access to the request information needed for file uploads.</div>
</td>
</tr>
<tr class="altColor">
<td class="colFirst"><a href="../../../../org/apache/commons/fileupload/UploadContext.html" title="interface in org.apache.commons.fileupload">UploadContext</a></td>
<td class="colLast">
<div class="block">Enhanced access to the request information needed for file uploads,
which fixes the Content Length data access in <a href="../../../../org/apache/commons/fileupload/RequestContext.html" title="interface in org.apache.commons.fileupload"><code>RequestContext</code></a>.</div>
</td>
</tr>
</tbody>
</table>
</li>
<li class="blockList">
<table class="typeSummary" border="0" cellpadding="3" cellspacing="0" summary="Class Summary table, listing classes, and an explanation">
<caption><span>Class Summary</span><span class="tabEnd">&nbsp;</span></caption>
<tr>
<th class="colFirst" scope="col">Class</th>
<th class="colLast" scope="col">Description</th>
</tr>
<tbody>
<tr class="altColor">
<td class="colFirst"><a href="../../../../org/apache/commons/fileupload/DefaultFileItem.html" title="class in org.apache.commons.fileupload">DefaultFileItem</a></td>
<td class="colLast">Deprecated
<div class="block"><span class="deprecationComment">1.1 Use <code>DiskFileItem</code> instead.</span></div>
</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><a href="../../../../org/apache/commons/fileupload/DefaultFileItemFactory.html" title="class in org.apache.commons.fileupload">DefaultFileItemFactory</a></td>
<td class="colLast">Deprecated
<div class="block"><span class="deprecationComment">1.1 Use <code>DiskFileItemFactory</code> instead.</span></div>
</td>
</tr>
<tr class="altColor">
<td class="colFirst"><a href="../../../../org/apache/commons/fileupload/DiskFileUpload.html" title="class in org.apache.commons.fileupload">DiskFileUpload</a></td>
<td class="colLast">Deprecated
<div class="block"><span class="deprecationComment">1.1 Use <code>ServletFileUpload</code> together with
<code>DiskFileItemFactory</code> instead.</span></div>
</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><a href="../../../../org/apache/commons/fileupload/FileUpload.html" title="class in org.apache.commons.fileupload">FileUpload</a></td>
<td class="colLast">
<div class="block">High level API for processing file uploads.</div>
</td>
</tr>
<tr class="altColor">
<td class="colFirst"><a href="../../../../org/apache/commons/fileupload/FileUploadBase.html" title="class in org.apache.commons.fileupload">FileUploadBase</a></td>
<td class="colLast">
<div class="block">High level API for processing file uploads.</div>
</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><a href="../../../../org/apache/commons/fileupload/MultipartStream.html" title="class in org.apache.commons.fileupload">MultipartStream</a></td>
<td class="colLast">
<div class="block"> Low level API for processing file uploads.</div>
</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><a href="../../../../org/apache/commons/fileupload/MultipartStream.ProgressNotifier.html" title="class in org.apache.commons.fileupload">MultipartStream.ProgressNotifier</a></td>
<td class="colLast">
<div class="block">Internal class, which is used to invoke the
<a href="../../../../org/apache/commons/fileupload/ProgressListener.html" title="interface in org.apache.commons.fileupload"><code>ProgressListener</code></a>.</div>
</td>
</tr>
<tr class="altColor">
<td class="colFirst"><a href="../../../../org/apache/commons/fileupload/ParameterParser.html" title="class in org.apache.commons.fileupload">ParameterParser</a></td>
<td class="colLast">
<div class="block">A simple parser intended to parse sequences of name/value pairs.</div>
</td>
</tr>
</tbody>
</table>
</li>
<li class="blockList">
<table class="typeSummary" border="0" cellpadding="3" cellspacing="0" summary="Exception Summary table, listing exceptions, and an explanation">
<caption><span>Exception Summary</span><span class="tabEnd">&nbsp;</span></caption>
<tr>
<th class="colFirst" scope="col">Exception</th>
<th class="colLast" scope="col">Description</th>
</tr>
<tbody>
<tr class="altColor">
<td class="colFirst"><a href="../../../../org/apache/commons/fileupload/FileItemStream.ItemSkippedException.html" title="class in org.apache.commons.fileupload">FileItemStream.ItemSkippedException</a></td>
<td class="colLast">
<div class="block">This exception is thrown, if an attempt is made to read
data from the <a href="https://docs.oracle.com/javase/7/docs/api/java/io/InputStream.html?is-external=true" title="class or interface in java.io"><code>InputStream</code></a>, which has been returned
by <a href="../../../../org/apache/commons/fileupload/FileItemStream.html#openStream--"><code>FileItemStream.openStream()</code></a>, after
<a href="https://docs.oracle.com/javase/7/docs/api/java/util/Iterator.html?is-external=true#hasNext--" title="class or interface in java.util"><code>Iterator.hasNext()</code></a> has been invoked on the
iterator, which created the <a href="../../../../org/apache/commons/fileupload/FileItemStream.html" title="interface in org.apache.commons.fileupload"><code>FileItemStream</code></a>.</div>
</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><a href="../../../../org/apache/commons/fileupload/FileUploadBase.FileSizeLimitExceededException.html" title="class in org.apache.commons.fileupload">FileUploadBase.FileSizeLimitExceededException</a></td>
<td class="colLast">
<div class="block">Thrown to indicate that A files size exceeds the configured maximum.</div>
</td>
</tr>
<tr class="altColor">
<td class="colFirst"><a href="../../../../org/apache/commons/fileupload/FileUploadBase.FileUploadIOException.html" title="class in org.apache.commons.fileupload">FileUploadBase.FileUploadIOException</a></td>
<td class="colLast">
<div class="block">This exception is thrown for hiding an inner
<a href="../../../../org/apache/commons/fileupload/FileUploadException.html" title="class in org.apache.commons.fileupload"><code>FileUploadException</code></a> in an <a href="https://docs.oracle.com/javase/7/docs/api/java/io/IOException.html?is-external=true" title="class or interface in java.io"><code>IOException</code></a>.</div>
</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><a href="../../../../org/apache/commons/fileupload/FileUploadBase.InvalidContentTypeException.html" title="class in org.apache.commons.fileupload">FileUploadBase.InvalidContentTypeException</a></td>
<td class="colLast">
<div class="block">Thrown to indicate that the request is not a multipart request.</div>
</td>
</tr>
<tr class="altColor">
<td class="colFirst"><a href="../../../../org/apache/commons/fileupload/FileUploadBase.IOFileUploadException.html" title="class in org.apache.commons.fileupload">FileUploadBase.IOFileUploadException</a></td>
<td class="colLast">
<div class="block">Thrown to indicate an IOException.</div>
</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><a href="../../../../org/apache/commons/fileupload/FileUploadBase.SizeException.html" title="class in org.apache.commons.fileupload">FileUploadBase.SizeException</a></td>
<td class="colLast">
<div class="block">This exception is thrown, if a requests permitted size
is exceeded.</div>
</td>
</tr>
<tr class="altColor">
<td class="colFirst"><a href="../../../../org/apache/commons/fileupload/FileUploadBase.SizeLimitExceededException.html" title="class in org.apache.commons.fileupload">FileUploadBase.SizeLimitExceededException</a></td>
<td class="colLast">
<div class="block">Thrown to indicate that the request size exceeds the configured maximum.</div>
</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><a href="../../../../org/apache/commons/fileupload/FileUploadBase.UnknownSizeException.html" title="class in org.apache.commons.fileupload">FileUploadBase.UnknownSizeException</a></td>
<td class="colLast">Deprecated
<div class="block"><span class="deprecationComment">1.2 As of commons-fileupload 1.2, the presence of a
content-length header is no longer required.</span></div>
</td>
</tr>
<tr class="altColor">
<td class="colFirst"><a href="../../../../org/apache/commons/fileupload/FileUploadException.html" title="class in org.apache.commons.fileupload">FileUploadException</a></td>
<td class="colLast">
<div class="block">Exception for errors encountered while processing the request.</div>
</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><a href="../../../../org/apache/commons/fileupload/InvalidFileNameException.html" title="class in org.apache.commons.fileupload">InvalidFileNameException</a></td>
<td class="colLast">
<div class="block">This exception is thrown in case of an invalid file name.</div>
</td>
</tr>
<tr class="altColor">
<td class="colFirst"><a href="../../../../org/apache/commons/fileupload/MultipartStream.IllegalBoundaryException.html" title="class in org.apache.commons.fileupload">MultipartStream.IllegalBoundaryException</a></td>
<td class="colLast">
<div class="block">Thrown upon attempt of setting an invalid boundary token.</div>
</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><a href="../../../../org/apache/commons/fileupload/MultipartStream.MalformedStreamException.html" title="class in org.apache.commons.fileupload">MultipartStream.MalformedStreamException</a></td>
<td class="colLast">
<div class="block">Thrown to indicate that the input stream fails to follow the
required syntax.</div>
</td>
</tr>
</tbody>
</table>
</li>
</ul>
<a name="package.description">
<!-- -->
</a>
<h2 title="Package org.apache.commons.fileupload Description">Package org.apache.commons.fileupload Description</h2>
<div class="block"><p>
A component for handling HTML file uploads as specified by
<a href="http://www.ietf.org/rfc/rfc1867.txt" target="_top">RFC&nbsp;1867</a>.
This component provides support for uploads within both servlets (JSR 53)
and portlets (JSR 168).
</p>
<p>
While this package provides the generic functionality for file uploads,
these classes are not typically used directly. Instead, normal usage
involves one of the provided extensions of
<a href="../../../../org/apache/commons/fileupload/FileUpload.html" title="class in org.apache.commons.fileupload"><code>FileUpload</code></a> such as
<a href="../../../../org/apache/commons/fileupload/servlet/ServletFileUpload.html" title="class in org.apache.commons.fileupload.servlet"><code>ServletFileUpload</code></a>
or
<a href="../../../../org/apache/commons/fileupload/portlet/PortletFileUpload.html" title="class in org.apache.commons.fileupload.portlet"><code>PortletFileUpload</code></a>,
together with a factory for
<a href="../../../../org/apache/commons/fileupload/FileItem.html" title="interface in org.apache.commons.fileupload"><code>FileItem</code></a> instances,
such as
<a href="../../../../org/apache/commons/fileupload/disk/DiskFileItemFactory.html" title="class in org.apache.commons.fileupload.disk"><code>DiskFileItemFactory</code></a>.
</p>
<p>
The following is a brief example of typical usage in a servlet, storing
the uploaded files on disk.
</p>
<pre>public void doPost(HttpServletRequest req, HttpServletResponse res) {
DiskFileItemFactory factory = new DiskFileItemFactory();
// maximum size that will be stored in memory
factory.setSizeThreshold(4096);
// the location for saving data that is larger than getSizeThreshold()
factory.setRepository(new File("/tmp"));
ServletFileUpload upload = new ServletFileUpload(factory);
// maximum size before a FileUploadException will be thrown
upload.setSizeMax(1000000);
List fileItems = upload.parseRequest(req);
// assume we know there are two files. The first file is a small
// text file, the second is unknown and is written to a file on
// the server
Iterator i = fileItems.iterator();
String comment = ((FileItem)i.next()).getString();
FileItem fi = (FileItem)i.next();
// filename on the client
String fileName = fi.getName();
// save comment and filename to database
...
// write the file
fi.write(new File("/www/uploads/", fileName));
}
</pre>
<p>
In the example above, the first file is loaded into memory as a
<code>String</code>. Before calling the <code>getString</code> method,
the data may have been in memory or on disk depending on its size. The
second file we assume it will be large and therefore never explicitly
load it into memory, though if it is less than 4096 bytes it will be
in memory before it is written to its final location. When writing to
the final location, if the data is larger than the threshold, an attempt
is made to rename the temporary file to the given location. If it cannot
be renamed, it is streamed to the new location.
</p>
<p>
Please see the FileUpload
<a href="http://commons.apache.org/fileupload/using.html" target="_top">User Guide</a>
for further details and examples of how to use this package.
</p></div>
</div>
<!-- ======= START OF BOTTOM NAVBAR ====== -->
<div class="bottomNav"><a name="navbar.bottom">
<!-- -->
</a>
<div class="skipNav"><a href="#skip.navbar.bottom" title="Skip navigation links">Skip navigation links</a></div>
<a name="navbar.bottom.firstrow">
<!-- -->
</a>
<ul class="navList" title="Navigation">
<li><a href="../../../../overview-summary.html">Overview</a></li>
<li class="navBarCell1Rev">Package</li>
<li>Class</li>
<li><a href="package-use.html">Use</a></li>
<li><a href="package-tree.html">Tree</a></li>
<li><a href="../../../../deprecated-list.html">Deprecated</a></li>
<li><a href="../../../../index-all.html">Index</a></li>
<li><a href="../../../../help-doc.html">Help</a></li>
</ul>
</div>
<div class="subNav">
<ul class="navList">
<li>Prev&nbsp;Package</li>
<li><a href="../../../../org/apache/commons/fileupload/disk/package-summary.html">Next&nbsp;Package</a></li>
</ul>
<ul class="navList">
<li><a href="../../../../index.html?org/apache/commons/fileupload/package-summary.html" target="_top">Frames</a></li>
<li><a href="package-summary.html" target="_top">No&nbsp;Frames</a></li>
</ul>
<ul class="navList" id="allclasses_navbar_bottom">
<li><a href="../../../../allclasses-noframe.html">All&nbsp;Classes</a></li>
</ul>
<div>
<script type="text/javascript"><!--
allClassesLink = document.getElementById("allclasses_navbar_bottom");
if(window==top) {
allClassesLink.style.display = "block";
}
else {
allClassesLink.style.display = "none";
}
//-->
</script>
</div>
<a name="skip.navbar.bottom">
<!-- -->
</a></div>
<!-- ======== END OF BOTTOM NAVBAR ======= -->
<p class="legalCopy"><small>Copyright &#169; 2002&#x2013;2018 <a href="https://www.apache.org/">The Apache Software Foundation</a>. All rights reserved.</small></p>
</body>
</html>