This is an automated email from the ASF dual-hosted git repository.
ggregory pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/commons-fileupload.git
The following commit(s) were added to refs/heads/master by this push:
new d254881 Javadoc
d254881 is described below
commit d254881de77b741ef96ca6fa1b0910a85c6fb66f
Author: Gary Gregory <[email protected]>
AuthorDate: Mon Apr 3 08:19:40 2023 -0400
Javadoc
---
.../commons/fileupload2/disk/DiskFileItem.java | 32 ++++++--------
.../fileupload2/disk/DiskFileItemFactory.java | 50 +++++++++++-----------
.../fileupload2/impl/FileItemIteratorImpl.java | 2 +-
.../fileupload2/impl/FileItemStreamImpl.java | 13 +++---
.../fileupload2/jaksrvlt/JakSrvltFileCleaner.java | 2 +-
.../fileupload2/jaksrvlt/JakSrvltFileUpload.java | 30 ++++++-------
.../jaksrvlt/JakSrvltRequestContext.java | 14 +++---
.../fileupload2/portlet/PortletFileUpload.java | 35 ++++++---------
.../fileupload2/portlet/PortletRequestContext.java | 12 +++---
.../fileupload2/servlet/FileCleanerCleanup.java | 2 +-
.../fileupload2/servlet/ServletFileUpload.java | 33 ++++++--------
.../fileupload2/util/LimitedInputStream.java | 4 +-
.../commons/fileupload2/util/mime/MimeUtility.java | 4 +-
.../util/mime/QuotedPrintableDecoder.java | 4 +-
.../fileupload2/util/mime/RFC2231Utility.java | 13 +++---
15 files changed, 116 insertions(+), 134 deletions(-)
diff --git
a/src/main/java/org/apache/commons/fileupload2/disk/DiskFileItem.java
b/src/main/java/org/apache/commons/fileupload2/disk/DiskFileItem.java
index 66ff34d..12f0d75 100644
--- a/src/main/java/org/apache/commons/fileupload2/disk/DiskFileItem.java
+++ b/src/main/java/org/apache/commons/fileupload2/disk/DiskFileItem.java
@@ -220,7 +220,7 @@ public class DiskFileItem implements FileItem {
}
/**
- * Returns the contents of the file as an array of bytes. If the
+ * Gets the contents of the file as an array of bytes. If the
* contents of the file were not yet cached in memory, they will be
* loaded from the disk storage and cached.
*
@@ -248,7 +248,7 @@ public class DiskFileItem implements FileItem {
}
/**
- * Returns the content charset passed by the agent or {@code null} if
+ * Gets the content charset passed by the agent or {@code null} if
* not defined.
*
* @return The content charset passed by the agent or {@code null} if
@@ -263,7 +263,7 @@ public class DiskFileItem implements FileItem {
}
/**
- * Returns the content type passed by the agent or {@code null} if
+ * Gets the content type passed by the agent or {@code null} if
* not defined.
*
* @return The content type passed by the agent or {@code null} if
@@ -275,7 +275,7 @@ public class DiskFileItem implements FileItem {
}
/**
- * Returns the default charset for use when no explicit charset
+ * Gets the default charset for use when no explicit charset
* parameter is provided by the sender.
*
* @return the default charset
@@ -285,7 +285,7 @@ public class DiskFileItem implements FileItem {
}
/**
- * Returns the name of the field in the multipart form corresponding to
+ * Gets the name of the field in the multipart form corresponding to
* this file item.
*
* @return The name of the form field.
@@ -297,7 +297,7 @@ public class DiskFileItem implements FileItem {
}
/**
- * Returns the file item headers.
+ * Gets the file item headers.
*
* @return The file items headers.
*/
@@ -307,7 +307,7 @@ public class DiskFileItem implements FileItem {
}
/**
- * Returns an {@link java.io.InputStream InputStream} that can be
+ * Gets an {@link java.io.InputStream InputStream} that can be
* used to retrieve the contents of the file.
*
* @return An {@link java.io.InputStream InputStream} that can be
@@ -328,7 +328,7 @@ public class DiskFileItem implements FileItem {
}
/**
- * Returns the original file name in the client's file system.
+ * Gets the original file name in the client's file system.
*
* @return The original file name in the client's file system.
* @throws org.apache.commons.fileupload2.InvalidFileNameException The
file name contains a NUL character,
@@ -342,7 +342,7 @@ public class DiskFileItem implements FileItem {
}
/**
- * Returns an {@link java.io.OutputStream OutputStream} that can
+ * Gets an {@link java.io.OutputStream OutputStream} that can
* be used for storing the contents of the file.
*
* @return An {@link java.io.OutputStream OutputStream} that can be used
@@ -358,7 +358,7 @@ public class DiskFileItem implements FileItem {
}
/**
- * Returns the size of the file.
+ * Gets the size of the file.
*
* @return The size of the file, in bytes.
*/
@@ -377,7 +377,7 @@ public class DiskFileItem implements FileItem {
}
/**
- * Returns the {@link java.io.File} object for the {@code FileItem}'s
+ * Gets the {@link java.io.File} object for the {@code FileItem}'s
* data's temporary location on the disk. Note that for
* {@code FileItem}s that have their data stored in memory,
* this method will return {@code null}. When handling large
@@ -400,7 +400,7 @@ public class DiskFileItem implements FileItem {
}
/**
- * Returns the contents of the file as a String, using the default
+ * Gets the contents of the file as a String, using the default
* character encoding. This method uses {@link #get()} to retrieve the
* contents of the file.
* <p>
@@ -423,14 +423,12 @@ public class DiskFileItem implements FileItem {
}
/**
- * Returns the contents of the file as a String, using the specified
+ * Gets the contents of the file as a String, using the specified
* encoding. This method uses {@link #get()} to retrieve the
* contents of the file.
*
* @param charset The charset to use.
- *
* @return The contents of the file, as a string.
- *
* @throws UnsupportedEncodingException if the requested character
* encoding is not available.
*/
@@ -457,16 +455,14 @@ public class DiskFileItem implements FileItem {
if (tempDir == null) {
tempDir = FileUtils.getTempDirectory();
}
-
final String tempFileName = format("upload_%s_%s.tmp", UID,
getUniqueId());
-
tempFile = new File(tempDir, tempFileName);
}
return tempFile;
}
/**
- * Determines whether or not a {@code FileItem} instance represents
+ * Tests whether or not a {@code FileItem} instance represents
* a simple form field.
*
* @return {@code true} if the instance represents a simple form
diff --git
a/src/main/java/org/apache/commons/fileupload2/disk/DiskFileItemFactory.java
b/src/main/java/org/apache/commons/fileupload2/disk/DiskFileItemFactory.java
index 1397e94..dcc8f4c 100644
--- a/src/main/java/org/apache/commons/fileupload2/disk/DiskFileItemFactory.java
+++ b/src/main/java/org/apache/commons/fileupload2/disk/DiskFileItemFactory.java
@@ -23,16 +23,20 @@ import org.apache.commons.fileupload2.FileItemFactory;
import org.apache.commons.io.FileCleaningTracker;
/**
- * <p>The default {@link org.apache.commons.fileupload2.FileItemFactory}
- * implementation. This implementation creates
+ * The default {@link org.apache.commons.fileupload2.FileItemFactory}
+ * implementation.
+ * <p>
+ * This implementation creates
* {@link org.apache.commons.fileupload2.FileItem} instances which keep their
* content either in memory, for smaller items, or in a temporary file on disk,
* for larger items. The size threshold, above which content will be stored on
* disk, is configurable, as is the directory in which temporary files will be
- * created.</p>
- *
- * <p>If not otherwise configured, the default configuration values are as
- * follows:</p>
+ * created.
+ * </p>
+ * <p>
+ * If not otherwise configured, the default configuration values are as
+ * follows:
+ * </p>
* <ul>
* <li>Size threshold is 10KB.</li>
* <li>Repository is the system default temp directory, as returned by
@@ -50,8 +54,8 @@ import org.apache.commons.io.FileCleaningTracker;
* by the ServletContext attribute {@code javax.servlet.context.tempdir}
* may be used.
* </p>
- *
- * <p>Temporary files, which are created for file items, should be
+ * <p>
+ * Temporary files, which are created for file items, should be
* deleted later on. The best way to do this is using a
* {@link FileCleaningTracker}, which you can set on the
* {@link DiskFileItemFactory}. However, if you do use such a tracker,
@@ -63,7 +67,8 @@ import org.apache.commons.io.FileCleaningTracker;
* tracked.
* It might make sense to terminate that thread, for example, if
* your web application ends. See the section on "Resource cleanup"
- * in the users guide of commons-fileupload.</p>
+ * in the users guide of commons-fileupload.
+ * </p>
*
* @since 1.1
*/
@@ -85,9 +90,11 @@ public class DiskFileItemFactory implements FileItemFactory {
private int sizeThreshold = DEFAULT_SIZE_THRESHOLD;
/**
- * <p>The instance of {@link FileCleaningTracker}, which is responsible
- * for deleting temporary files.</p>
- * <p>May be null, if tracking files is not required.</p>
+ * The instance of {@link FileCleaningTracker}, which is responsible
+ * for deleting temporary files.
+ * <p>
+ * May be null, if tracking files is not required.
+ * </p>
*/
private FileCleaningTracker fileCleaningTracker;
@@ -121,7 +128,7 @@ public class DiskFileItemFactory implements FileItemFactory
{
}
/**
- * Create a new {@link org.apache.commons.fileupload2.disk.DiskFileItem}
+ * Creates a new {@link org.apache.commons.fileupload2.disk.DiskFileItem}
* instance from the supplied parameters and the local factory
* configuration.
*
@@ -131,7 +138,6 @@ public class DiskFileItemFactory implements FileItemFactory
{
* {@code false} otherwise.
* @param fileName The name of the uploaded file, if any, as supplied
* by the browser or other client.
- *
* @return The newly created file item.
*/
@Override
@@ -148,8 +154,9 @@ public class DiskFileItemFactory implements FileItemFactory
{
}
/**
- * Returns the default charset for use when no explicit charset
+ * Gets the default charset for use when no explicit charset
* parameter is provided by the sender.
+ *
* @return the default charset
*/
public String getDefaultCharset() {
@@ -157,7 +164,7 @@ public class DiskFileItemFactory implements FileItemFactory
{
}
/**
- * Returns the tracker, which is responsible for deleting temporary
+ * Gets the tracker, which is responsible for deleting temporary
* files.
*
* @return An instance of {@link FileCleaningTracker}, or null
@@ -168,24 +175,21 @@ public class DiskFileItemFactory implements
FileItemFactory {
}
/**
- * Returns the directory used to temporarily store files that are larger
+ * Gets the directory used to temporarily store files that are larger
* than the configured size threshold.
*
* @return The directory in which temporary files will be located.
- *
* @see #setRepository(java.io.File)
- *
*/
public File getRepository() {
return repository;
}
/**
- * Returns the size threshold beyond which files are written directly to
+ * Gets the size threshold beyond which files are written directly to
* disk. The default value is 10240 bytes.
*
* @return The size threshold, in bytes.
- *
* @see #setSizeThreshold(int)
*/
public int getSizeThreshold() {
@@ -218,9 +222,7 @@ public class DiskFileItemFactory implements FileItemFactory
{
* than the configured size threshold.
*
* @param repository The directory in which temporary files will be
located.
- *
* @see #getRepository()
- *
*/
public void setRepository(final File repository) {
this.repository = repository;
@@ -230,9 +232,7 @@ public class DiskFileItemFactory implements FileItemFactory
{
* Sets the size threshold beyond which files are written directly to disk.
*
* @param sizeThreshold The size threshold, in bytes.
- *
* @see #getSizeThreshold()
- *
*/
public void setSizeThreshold(final int sizeThreshold) {
this.sizeThreshold = sizeThreshold;
diff --git
a/src/main/java/org/apache/commons/fileupload2/impl/FileItemIteratorImpl.java
b/src/main/java/org/apache/commons/fileupload2/impl/FileItemIteratorImpl.java
index da77671..90e6773 100644
---
a/src/main/java/org/apache/commons/fileupload2/impl/FileItemIteratorImpl.java
+++
b/src/main/java/org/apache/commons/fileupload2/impl/FileItemIteratorImpl.java
@@ -128,7 +128,7 @@ public class FileItemIteratorImpl implements
FileItemIterator {
}
/**
- * Called for finding the next item, if any.
+ * Finds the next item, if any.
*
* @return True, if an next item was found, otherwise false.
* @throws IOException An I/O error occurred.
diff --git
a/src/main/java/org/apache/commons/fileupload2/impl/FileItemStreamImpl.java
b/src/main/java/org/apache/commons/fileupload2/impl/FileItemStreamImpl.java
index 6a49334..3572a05 100644
--- a/src/main/java/org/apache/commons/fileupload2/impl/FileItemStreamImpl.java
+++ b/src/main/java/org/apache/commons/fileupload2/impl/FileItemStreamImpl.java
@@ -34,6 +34,7 @@ import org.apache.commons.fileupload2.util.LimitedInputStream;
* Default implementation of {@link FileItemStream}.
*/
public class FileItemStreamImpl implements FileItemStream {
+
/**
* The File Item iterator implementation.
*
@@ -128,7 +129,7 @@ public class FileItemStreamImpl implements FileItemStream {
}
/**
- * Returns the items content type, or null.
+ * Gets the items content type, or null.
*
* @return Content type, if known, or null.
*/
@@ -138,7 +139,7 @@ public class FileItemStreamImpl implements FileItemStream {
}
/**
- * Returns the items field name.
+ * Gets the items field name.
*
* @return Field name.
*/
@@ -148,7 +149,7 @@ public class FileItemStreamImpl implements FileItemStream {
}
/**
- * Returns the file item headers.
+ * Gets the file item headers.
*
* @return The items header object
*/
@@ -158,7 +159,7 @@ public class FileItemStreamImpl implements FileItemStream {
}
/**
- * Returns the items file name.
+ * Gets the items file name.
*
* @return File name, if known, or null.
* @throws InvalidFileNameException The file name contains a NUL
character, which might be an indicator of a security attack. If you intend to
use the file
@@ -170,7 +171,7 @@ public class FileItemStreamImpl implements FileItemStream {
}
/**
- * Returns, whether this is a form field.
+ * Tests whether this is a form field.
*
* @return True, if the item is a form field, otherwise false.
*/
@@ -180,7 +181,7 @@ public class FileItemStreamImpl implements FileItemStream {
}
/**
- * Returns an input stream, which may be used to read the items contents.
+ * Gets the input stream, which may be used to read the items contents.
*
* @return Opened input stream.
* @throws IOException An I/O error occurred.
diff --git
a/src/main/java/org/apache/commons/fileupload2/jaksrvlt/JakSrvltFileCleaner.java
b/src/main/java/org/apache/commons/fileupload2/jaksrvlt/JakSrvltFileCleaner.java
index d483f4d..f213f01 100644
---
a/src/main/java/org/apache/commons/fileupload2/jaksrvlt/JakSrvltFileCleaner.java
+++
b/src/main/java/org/apache/commons/fileupload2/jaksrvlt/JakSrvltFileCleaner.java
@@ -38,7 +38,7 @@ public class JakSrvltFileCleaner implements
ServletContextListener {
= JakSrvltFileCleaner.class.getName() + ".FileCleaningTracker";
/**
- * Returns the instance of {@link FileCleaningTracker}, which is
+ * Gets the instance of {@link FileCleaningTracker}, which is
* associated with the given {@link ServletContext}.
*
* @param pServletContext The servlet context to query
diff --git
a/src/main/java/org/apache/commons/fileupload2/jaksrvlt/JakSrvltFileUpload.java
b/src/main/java/org/apache/commons/fileupload2/jaksrvlt/JakSrvltFileUpload.java
index 1912373..b2bc3c1 100644
---
a/src/main/java/org/apache/commons/fileupload2/jaksrvlt/JakSrvltFileUpload.java
+++
b/src/main/java/org/apache/commons/fileupload2/jaksrvlt/JakSrvltFileUpload.java
@@ -30,18 +30,20 @@ import org.apache.commons.fileupload2.FileUploadException;
import jakarta.servlet.http.HttpServletRequest;
/**
- * <p>High level API for processing file uploads.</p>
- *
- * <p>This class handles multiple files per single HTML widget, sent using
+ * High level API for processing file uploads.
+ * <p>
+ * This class handles multiple files per single HTML widget, sent using
* {@code multipart/mixed} encoding type, as specified by
* <a href="http://www.ietf.org/rfc/rfc1867.txt">RFC 1867</a>. Use {@link
* #parseRequest(HttpServletRequest)} to acquire a list of {@link
* org.apache.commons.fileupload2.FileItem}s associated with a given HTML
- * widget.</p>
- *
- * <p>How the data for individual parts is stored is determined by the factory
+ * widget.
+ * </p>
+ * <p>
+ * How the data for individual parts is stored is determined by the factory
* used to create them; a given part may be in memory, on disk, or somewhere
- * else.</p>
+ * else.
+ * </p>
*/
public class JakSrvltFileUpload extends FileUpload {
@@ -89,15 +91,13 @@ public class JakSrvltFileUpload extends FileUpload {
}
/**
- * Processes an <a href="http://www.ietf.org/rfc/rfc1867.txt">RFC 1867</a>
- * compliant {@code multipart/form-data} stream.
+ * Gets an <a href="http://www.ietf.org/rfc/rfc1867.txt">RFC 1867</a>
+ * compliant {@code multipart/form-data} file item iterator.
*
* @param request The servlet request to be parsed.
- *
* @return An iterator to instances of {@code FileItemStream}
* parsed from the request, in the order that they were
* transmitted.
- *
* @throws FileUploadException if there are problems reading/parsing
* the request or storing files.
* @throws IOException An I/O error occurred. This may be a network
@@ -110,13 +110,11 @@ public class JakSrvltFileUpload extends FileUpload {
}
/**
- * Processes an <a href="http://www.ietf.org/rfc/rfc1867.txt">RFC 1867</a>
+ * Parses an <a href="http://www.ietf.org/rfc/rfc1867.txt">RFC 1867</a>
* compliant {@code multipart/form-data} stream.
*
* @param request The servlet request to be parsed.
- *
* @return A map of {@code FileItem} instances parsed from the request.
- *
* @throws FileUploadException if there are problems reading/parsing
* the request or storing files.
*
@@ -128,14 +126,12 @@ public class JakSrvltFileUpload extends FileUpload {
}
/**
- * Processes an <a href="http://www.ietf.org/rfc/rfc1867.txt">RFC 1867</a>
+ * Parses an <a href="http://www.ietf.org/rfc/rfc1867.txt">RFC 1867</a>
* compliant {@code multipart/form-data} stream.
*
* @param request The servlet request to be parsed.
- *
* @return A list of {@code FileItem} instances parsed from the
* request, in the order that they were transmitted.
- *
* @throws FileUploadException if there are problems reading/parsing
* the request or storing files.
*/
diff --git
a/src/main/java/org/apache/commons/fileupload2/jaksrvlt/JakSrvltRequestContext.java
b/src/main/java/org/apache/commons/fileupload2/jaksrvlt/JakSrvltRequestContext.java
index 9855c42..f2b6685 100644
---
a/src/main/java/org/apache/commons/fileupload2/jaksrvlt/JakSrvltRequestContext.java
+++
b/src/main/java/org/apache/commons/fileupload2/jaksrvlt/JakSrvltRequestContext.java
@@ -27,8 +27,8 @@ import org.apache.commons.fileupload2.UploadContext;
import jakarta.servlet.http.HttpServletRequest;
/**
- * <p>Provides access to the request information needed for a request made to
- * an HTTP servlet.</p>
+ * Provides access to the request information needed for a request made to
+ * an HTTP servlet.
*
* @since 1.1
*/
@@ -49,7 +49,7 @@ public class JakSrvltRequestContext implements UploadContext {
}
/**
- * Retrieve the content length of the request.
+ * Gets the content length of the request.
*
* @return The content length of the request.
* @since 1.3
@@ -66,7 +66,7 @@ public class JakSrvltRequestContext implements UploadContext {
}
/**
- * Retrieve the character encoding for the request.
+ * Gets the character encoding for the request.
*
* @return The character encoding for the request.
*/
@@ -76,7 +76,7 @@ public class JakSrvltRequestContext implements UploadContext {
}
/**
- * Retrieve the content type of the request.
+ * Gets the content type of the request.
*
* @return The content type of the request.
*/
@@ -86,7 +86,7 @@ public class JakSrvltRequestContext implements UploadContext {
}
/**
- * Retrieve the input stream for the request.
+ * Gets the input stream for the request.
*
* @return The input stream for the request.
*
@@ -98,7 +98,7 @@ public class JakSrvltRequestContext implements UploadContext {
}
/**
- * Returns a string representation of this object.
+ * Gets a string representation of this object.
*
* @return a string representation of this object.
*/
diff --git
a/src/main/java/org/apache/commons/fileupload2/portlet/PortletFileUpload.java
b/src/main/java/org/apache/commons/fileupload2/portlet/PortletFileUpload.java
index f0f6df4..00a6e82 100644
---
a/src/main/java/org/apache/commons/fileupload2/portlet/PortletFileUpload.java
+++
b/src/main/java/org/apache/commons/fileupload2/portlet/PortletFileUpload.java
@@ -30,30 +30,30 @@ import org.apache.commons.fileupload2.FileUploadBase;
import org.apache.commons.fileupload2.FileUploadException;
/**
- * <p>High level API for processing file uploads.</p>
- *
- * <p>This class handles multiple files per single HTML widget, sent using
+ * High level API for processing file uploads.
+ * <p>
+ * This class handles multiple files per single HTML widget, sent using
* {@code multipart/mixed} encoding type, as specified by
* <a href="http://www.ietf.org/rfc/rfc1867.txt">RFC 1867</a>. Use
* {@link org.apache.commons.fileupload2.servlet.ServletFileUpload
* #parseRequest(javax.servlet.http.HttpServletRequest)} to acquire a list
* of {@link org.apache.commons.fileupload2.FileItem FileItems} associated
- * with a given HTML widget.</p>
- *
- * <p>How the data for individual parts is stored is determined by the factory
+ * with a given HTML widget.
+ * </p>
+ * <p>
+ * How the data for individual parts is stored is determined by the factory
* used to create them; a given part may be in memory, on disk, or somewhere
- * else.</p>
- *
+ * else.
+ * </p>
* @since 1.1
*/
public class PortletFileUpload extends FileUpload {
/**
- * Utility method that determines whether the request contains multipart
+ * Tests whether the request contains multipart
* content.
*
* @param request The portlet request to be evaluated. Must be non-null.
- *
* @return {@code true} if the request is multipart;
* {@code false} otherwise.
*/
@@ -84,15 +84,13 @@ public class PortletFileUpload extends FileUpload {
}
/**
- * Processes an <a href="http://www.ietf.org/rfc/rfc1867.txt">RFC 1867</a>
- * compliant {@code multipart/form-data} stream.
+ * Gets an <a href="http://www.ietf.org/rfc/rfc1867.txt">RFC 1867</a>
+ * compliant {@code multipart/form-data} file item iterator.
*
* @param request The portlet request to be parsed.
- *
* @return An iterator to instances of {@code FileItemStream}
* parsed from the request, in the order that they were
* transmitted.
- *
* @throws FileUploadException if there are problems reading/parsing
* the request or storing files.
* @throws IOException An I/O error occurred. This may be a network
@@ -105,16 +103,13 @@ public class PortletFileUpload extends FileUpload {
}
/**
- * Processes an <a href="http://www.ietf.org/rfc/rfc1867.txt">RFC 1867</a>
+ * Parses an <a href="http://www.ietf.org/rfc/rfc1867.txt">RFC 1867</a>
* compliant {@code multipart/form-data} stream.
*
* @param request The portlet request to be parsed.
- *
* @return A map of {@code FileItem} instances parsed from the request.
- *
* @throws FileUploadException if there are problems reading/parsing
* the request or storing files.
- *
* @since 1.3
*/
public Map<String, List<FileItem>> parseParameterMap(final ActionRequest
request)
@@ -123,14 +118,12 @@ public class PortletFileUpload extends FileUpload {
}
/**
- * Processes an <a href="http://www.ietf.org/rfc/rfc1867.txt">RFC 1867</a>
+ * Parses an <a href="http://www.ietf.org/rfc/rfc1867.txt">RFC 1867</a>
* compliant {@code multipart/form-data} stream.
*
* @param request The portlet request to be parsed.
- *
* @return A list of {@code FileItem} instances parsed from the
* request, in the order that they were transmitted.
- *
* @throws FileUploadException if there are problems reading/parsing
* the request or storing files.
*/
diff --git
a/src/main/java/org/apache/commons/fileupload2/portlet/PortletRequestContext.java
b/src/main/java/org/apache/commons/fileupload2/portlet/PortletRequestContext.java
index eac6510..455dbf6 100644
---
a/src/main/java/org/apache/commons/fileupload2/portlet/PortletRequestContext.java
+++
b/src/main/java/org/apache/commons/fileupload2/portlet/PortletRequestContext.java
@@ -27,8 +27,8 @@ import org.apache.commons.fileupload2.FileUploadBase;
import org.apache.commons.fileupload2.UploadContext;
/**
- * <p>Provides access to the request information needed for a request made to
- * a portlet.</p>
+ * Provides access to the request information needed for a request made to
+ * a portlet.
*
* @since 1.1
*/
@@ -49,7 +49,7 @@ public class PortletRequestContext implements UploadContext {
}
/**
- * Retrieve the content length of the request.
+ * Gets the content length of the request.
*
* @return The content length of the request.
* @since 1.3
@@ -66,7 +66,7 @@ public class PortletRequestContext implements UploadContext {
}
/**
- * Retrieve the character encoding for the request.
+ * Gets the character encoding for the request.
*
* @return The character encoding for the request.
*/
@@ -76,7 +76,7 @@ public class PortletRequestContext implements UploadContext {
}
/**
- * Retrieve the content type of the request.
+ * Gets the content type of the request.
*
* @return The content type of the request.
*/
@@ -86,7 +86,7 @@ public class PortletRequestContext implements UploadContext {
}
/**
- * Retrieve the input stream for the request.
+ * Gets the input stream for the request.
*
* @return The input stream for the request.
*
diff --git
a/src/main/java/org/apache/commons/fileupload2/servlet/FileCleanerCleanup.java
b/src/main/java/org/apache/commons/fileupload2/servlet/FileCleanerCleanup.java
index f429b2d..7f695b6 100644
---
a/src/main/java/org/apache/commons/fileupload2/servlet/FileCleanerCleanup.java
+++
b/src/main/java/org/apache/commons/fileupload2/servlet/FileCleanerCleanup.java
@@ -37,7 +37,7 @@ public class FileCleanerCleanup implements
ServletContextListener {
= FileCleanerCleanup.class.getName() + ".FileCleaningTracker";
/**
- * Returns the instance of {@link FileCleaningTracker}, which is
+ * Gets the instance of {@link FileCleaningTracker}, which is
* associated with the given {@link ServletContext}.
*
* @param pServletContext The servlet context to query
diff --git
a/src/main/java/org/apache/commons/fileupload2/servlet/ServletFileUpload.java
b/src/main/java/org/apache/commons/fileupload2/servlet/ServletFileUpload.java
index 4e3f061..e445b4a 100644
---
a/src/main/java/org/apache/commons/fileupload2/servlet/ServletFileUpload.java
+++
b/src/main/java/org/apache/commons/fileupload2/servlet/ServletFileUpload.java
@@ -30,18 +30,20 @@ import org.apache.commons.fileupload2.FileUploadBase;
import org.apache.commons.fileupload2.FileUploadException;
/**
- * <p>High level API for processing file uploads.</p>
- *
- * <p>This class handles multiple files per single HTML widget, sent using
+ * High level API for processing file uploads.
+ * <p>
+ * This class handles multiple files per single HTML widget, sent using
* {@code multipart/mixed} encoding type, as specified by
* <a href="http://www.ietf.org/rfc/rfc1867.txt">RFC 1867</a>. Use {@link
* #parseRequest(HttpServletRequest)} to acquire a list of {@link
* org.apache.commons.fileupload2.FileItem}s associated with a given HTML
- * widget.</p>
- *
- * <p>How the data for individual parts is stored is determined by the factory
+ * widget.
+ * </p>
+ * <p>
+ * How the data for individual parts is stored is determined by the factory
* used to create them; a given part may be in memory, on disk, or somewhere
- * else.</p>
+ * else.
+ * </p>
*/
public class ServletFileUpload extends FileUpload {
@@ -51,7 +53,7 @@ public class ServletFileUpload extends FileUpload {
private static final String POST_METHOD = "POST";
/**
- * Utility method that determines whether the request contains multipart
+ * Tests whether the request contains multipart
* content.
*
* @param request The servlet request to be evaluated. Must be non-null.
@@ -89,15 +91,13 @@ public class ServletFileUpload extends FileUpload {
}
/**
- * Processes an <a href="http://www.ietf.org/rfc/rfc1867.txt">RFC 1867</a>
- * compliant {@code multipart/form-data} stream.
+ * Gets an <a href="http://www.ietf.org/rfc/rfc1867.txt">RFC 1867</a>
+ * compliant {@code multipart/form-data} file item iterator.
*
* @param request The servlet request to be parsed.
- *
* @return An iterator to instances of {@code FileItemStream}
* parsed from the request, in the order that they were
* transmitted.
- *
* @throws FileUploadException if there are problems reading/parsing
* the request or storing files.
* @throws IOException An I/O error occurred. This may be a network
@@ -109,16 +109,13 @@ public class ServletFileUpload extends FileUpload {
}
/**
- * Processes an <a href="http://www.ietf.org/rfc/rfc1867.txt">RFC 1867</a>
+ * Parses an <a href="http://www.ietf.org/rfc/rfc1867.txt">RFC 1867</a>
* compliant {@code multipart/form-data} stream.
*
* @param request The servlet request to be parsed.
- *
* @return A map of {@code FileItem} instances parsed from the request.
- *
* @throws FileUploadException if there are problems reading/parsing
* the request or storing files.
- *
* @since 1.3
*/
public Map<String, List<FileItem>> parseParameterMap(final
HttpServletRequest request) throws FileUploadException {
@@ -126,14 +123,12 @@ public class ServletFileUpload extends FileUpload {
}
/**
- * Processes an <a href="http://www.ietf.org/rfc/rfc1867.txt">RFC 1867</a>
+ * Parses an <a href="http://www.ietf.org/rfc/rfc1867.txt">RFC 1867</a>
* compliant {@code multipart/form-data} stream.
*
* @param request The servlet request to be parsed.
- *
* @return A list of {@code FileItem} instances parsed from the
* request, in the order that they were transmitted.
- *
* @throws FileUploadException if there are problems reading/parsing
* the request or storing files.
*/
diff --git
a/src/main/java/org/apache/commons/fileupload2/util/LimitedInputStream.java
b/src/main/java/org/apache/commons/fileupload2/util/LimitedInputStream.java
index ccd77d7..b4b678c 100644
--- a/src/main/java/org/apache/commons/fileupload2/util/LimitedInputStream.java
+++ b/src/main/java/org/apache/commons/fileupload2/util/LimitedInputStream.java
@@ -97,7 +97,7 @@ public abstract class LimitedInputStream extends
FilterInputStream {
* <p>
* This method
* simply performs {@code in.read()} and returns the result.
- *
+ * </p>
* @return the next byte of data, or {@code -1} if the end of the
* stream is reached.
* @throws IOException if an I/O error occurs.
@@ -121,7 +121,7 @@ public abstract class LimitedInputStream extends
FilterInputStream {
* <p>
* This method simply performs {@code in.read(b, off, len)}
* and returns the result.
- *
+ * </p>
* @param b the buffer into which the data is read.
* @param off The start offset in the destination array
* {@code b}.
diff --git
a/src/main/java/org/apache/commons/fileupload2/util/mime/MimeUtility.java
b/src/main/java/org/apache/commons/fileupload2/util/mime/MimeUtility.java
index 9f61f6f..c2fc47a 100644
--- a/src/main/java/org/apache/commons/fileupload2/util/mime/MimeUtility.java
+++ b/src/main/java/org/apache/commons/fileupload2/util/mime/MimeUtility.java
@@ -76,7 +76,7 @@ public final class MimeUtility {
}
/**
- * Decode a string of text obtained from a mail header into
+ * Decodes a string of text obtained from a mail header into
* its proper form. The text generally will consist of a
* string of tokens, some of which may be encoded using
* base64 encoding.
@@ -175,7 +175,7 @@ public final class MimeUtility {
}
/**
- * Parse a string using the RFC 2047 rules for an "encoded-word"
+ * Decodes a string using the RFC 2047 rules for an "encoded-word"
* type. This encoding has the syntax:
*
* encoded-word = "=?" charset "?" encoding "?" encoded-text "?="
diff --git
a/src/main/java/org/apache/commons/fileupload2/util/mime/QuotedPrintableDecoder.java
b/src/main/java/org/apache/commons/fileupload2/util/mime/QuotedPrintableDecoder.java
index 9d91b76..1eb0b7b 100644
---
a/src/main/java/org/apache/commons/fileupload2/util/mime/QuotedPrintableDecoder.java
+++
b/src/main/java/org/apache/commons/fileupload2/util/mime/QuotedPrintableDecoder.java
@@ -31,7 +31,7 @@ final class QuotedPrintableDecoder {
private static final int UPPER_NIBBLE_SHIFT = Byte.SIZE / 2;
/**
- * Decode the encoded byte data writing it to the given output stream.
+ * Decodes the encoded byte data writing it to the given output stream.
*
* @param data The array of byte data to decode.
* @param out The output stream used to return the decoded data.
@@ -87,7 +87,7 @@ final class QuotedPrintableDecoder {
}
/**
- * Convert a hex digit to the binary value it represents.
+ * Converts a hex digit to the binary value it represents.
*
* @param b the ascii hex byte to convert (0-0, A-F, a-f)
* @return the int value of the hex byte, 0-15
diff --git
a/src/main/java/org/apache/commons/fileupload2/util/mime/RFC2231Utility.java
b/src/main/java/org/apache/commons/fileupload2/util/mime/RFC2231Utility.java
index 49b6a8a..5dd6cfd 100644
--- a/src/main/java/org/apache/commons/fileupload2/util/mime/RFC2231Utility.java
+++ b/src/main/java/org/apache/commons/fileupload2/util/mime/RFC2231Utility.java
@@ -21,16 +21,16 @@ import java.io.UnsupportedEncodingException;
/**
* Utility class to decode/encode character set on HTTP Header fields based on
RFC 2231.
* This implementation adheres to RFC 5987 in particular, which was defined
for HTTP headers
- *
+ * <p>
* RFC 5987 builds on RFC 2231, but has lesser scope like
* <a href="https://tools.ietf.org/html/rfc5987#section-3.2">mandatory charset
definition</a>
* and <a href="https://tools.ietf.org/html/rfc5987#section-4">no parameter
continuation</a>
- *
- * <p>
+ * </p>
* @see <a href="https://tools.ietf.org/html/rfc2231">RFC 2231</a>
* @see <a href="https://tools.ietf.org/html/rfc5987">RFC 5987</a>
*/
public final class RFC2231Utility {
+
/**
* The Hexadecimal values char array.
*/
@@ -57,7 +57,7 @@ public final class RFC2231Utility {
}
/**
- * Decode a string of text obtained from a HTTP header as per RFC 2231
+ * Decodes a string of text obtained from a HTTP header as per RFC 2231
*
* <b>Eg 1.</b> {@code us-ascii'en-us'This%20is%20%2A%2A%2Afun%2A%2A%2A}
* will be decoded to {@code This is ***fun***}
@@ -90,7 +90,8 @@ public final class RFC2231Utility {
}
/**
- * Convert {@code text} to their corresponding Hex value.
+ * Converts {@code text} to their corresponding Hex value.
+ *
* @param text - ASCII text input
* @return Byte array of characters decoded from ASCII table
*/
@@ -119,7 +120,7 @@ public final class RFC2231Utility {
}
/**
- * Checks if Asterisk (*) at the end of parameter name to indicate,
+ * Tests if asterisk (*) at the end of parameter name to indicate,
* if it has charset and language information to decode the value.
* @param paramName The parameter, which is being checked.
* @return {@code true}, if encoded as per RFC 2231, {@code false}
otherwise