Author: markt
Date: Fri Mar 15 10:37:13 2013
New Revision: 1456872
URL: http://svn.apache.org/r1456872
Log:
Merge updates from Commons FileUpload to r1453230
Modified:
tomcat/trunk/java/org/apache/catalina/connector/Request.java
tomcat/trunk/java/org/apache/tomcat/util/http/fileupload/ (props changed)
tomcat/trunk/java/org/apache/tomcat/util/http/fileupload/FileItem.java
tomcat/trunk/java/org/apache/tomcat/util/http/fileupload/FileItemFactory.java
tomcat/trunk/java/org/apache/tomcat/util/http/fileupload/FileItemHeaders.java
tomcat/trunk/java/org/apache/tomcat/util/http/fileupload/FileItemHeadersSupport.java
tomcat/trunk/java/org/apache/tomcat/util/http/fileupload/FileItemIterator.java
tomcat/trunk/java/org/apache/tomcat/util/http/fileupload/FileItemStream.java
tomcat/trunk/java/org/apache/tomcat/util/http/fileupload/FileUpload.java
tomcat/trunk/java/org/apache/tomcat/util/http/fileupload/InvalidFileNameException.java
tomcat/trunk/java/org/apache/tomcat/util/http/fileupload/disk/DiskFileItem.java
tomcat/trunk/java/org/apache/tomcat/util/http/fileupload/disk/DiskFileItemFactory.java
tomcat/trunk/java/org/apache/tomcat/util/http/fileupload/servlet/ServletFileUpload.java
tomcat/trunk/java/org/apache/tomcat/util/http/fileupload/servlet/ServletRequestContext.java
tomcat/trunk/java/org/apache/tomcat/util/http/fileupload/util/Closeable.java
tomcat/trunk/java/org/apache/tomcat/util/http/fileupload/util/FileItemHeadersImpl.java
tomcat/trunk/java/org/apache/tomcat/util/http/fileupload/util/LimitedInputStream.java
tomcat/trunk/java/org/apache/tomcat/util/http/fileupload/util/Streams.java
Modified: tomcat/trunk/java/org/apache/catalina/connector/Request.java
URL:
http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/catalina/connector/Request.java?rev=1456872&r1=1456871&r2=1456872&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/catalina/connector/Request.java (original)
+++ tomcat/trunk/java/org/apache/catalina/connector/Request.java Fri Mar 15
10:37:13 2013
@@ -92,6 +92,7 @@ import org.apache.tomcat.util.http.fileu
import org.apache.tomcat.util.http.fileupload.FileUploadException;
import org.apache.tomcat.util.http.fileupload.disk.DiskFileItemFactory;
import org.apache.tomcat.util.http.fileupload.servlet.ServletFileUpload;
+import org.apache.tomcat.util.http.fileupload.servlet.ServletRequestContext;
import org.apache.tomcat.util.res.StringManager;
@@ -2591,7 +2592,8 @@ public class Request
parts = new ArrayList<>();
try {
- List<FileItem> items = upload.parseRequest(this);
+ List<FileItem> items =
+ upload.parseRequest(new ServletRequestContext(this));
int maxPostSize = getConnector().getMaxPostSize();
int postSize = 0;
String enc = getCharacterEncoding();
Propchange: tomcat/trunk/java/org/apache/tomcat/util/http/fileupload/
------------------------------------------------------------------------------
Merged
/commons/proper/fileupload/trunk/src/main/java/org/apache/commons/fileupload:r1453203-1453230
Modified: tomcat/trunk/java/org/apache/tomcat/util/http/fileupload/FileItem.java
URL:
http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/tomcat/util/http/fileupload/FileItem.java?rev=1456872&r1=1456871&r2=1456872&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/tomcat/util/http/fileupload/FileItem.java
(original)
+++ tomcat/trunk/java/org/apache/tomcat/util/http/fileupload/FileItem.java Fri
Mar 15 10:37:13 2013
@@ -52,10 +52,8 @@ import java.io.UnsupportedEncodingExcept
*/
public interface FileItem extends Serializable, FileItemHeadersSupport {
-
// ------------------------------- Methods from javax.activation.DataSource
-
/**
* Returns an {@link java.io.InputStream InputStream} that can be
* used to retrieve the contents of the file.
@@ -67,7 +65,6 @@ public interface FileItem extends Serial
*/
InputStream getInputStream() throws IOException;
-
/**
* Returns the content type passed by the browser or <code>null</code> if
* not defined.
@@ -77,7 +74,6 @@ public interface FileItem extends Serial
*/
String getContentType();
-
/**
* Returns the original filename in the client's filesystem, as provided by
* the browser (or other client software). In most cases, this will be the
@@ -92,10 +88,8 @@ public interface FileItem extends Serial
*/
String getName();
-
// ------------------------------------------------------- FileItem methods
-
/**
* Provides a hint as to whether or not the file contents will be read
* from memory.
@@ -105,7 +99,6 @@ public interface FileItem extends Serial
*/
boolean isInMemory();
-
/**
* Returns the size of the file item.
*
@@ -113,7 +106,6 @@ public interface FileItem extends Serial
*/
long getSize();
-
/**
* Returns the contents of the file item as an array of bytes.
*
@@ -121,7 +113,6 @@ public interface FileItem extends Serial
*/
byte[] get();
-
/**
* Returns the contents of the file item as a String, using the specified
* encoding. This method uses {@link #get()} to retrieve the
@@ -136,7 +127,6 @@ public interface FileItem extends Serial
*/
String getString(String encoding) throws UnsupportedEncodingException;
-
/**
* Returns the contents of the file item as a String, using the default
* character encoding. This method uses {@link #get()} to retrieve the
@@ -146,7 +136,6 @@ public interface FileItem extends Serial
*/
String getString();
-
/**
* A convenience method to write an uploaded item to disk. The client code
* is not concerned with whether or not the item is stored in memory, or on
@@ -165,7 +154,6 @@ public interface FileItem extends Serial
*/
void write(File file) throws Exception;
-
/**
* Deletes the underlying storage for a file item, including deleting any
* associated temporary disk file. Although this storage will be deleted
@@ -175,7 +163,6 @@ public interface FileItem extends Serial
*/
void delete();
-
/**
* Returns the name of the field in the multipart form corresponding to
* this file item.
@@ -184,7 +171,6 @@ public interface FileItem extends Serial
*/
String getFieldName();
-
/**
* Sets the field name used to reference this file item.
*
@@ -192,7 +178,6 @@ public interface FileItem extends Serial
*/
void setFieldName(String name);
-
/**
* Determines whether or not a <code>FileItem</code> instance represents
* a simple form field.
@@ -202,7 +187,6 @@ public interface FileItem extends Serial
*/
boolean isFormField();
-
/**
* Specifies whether or not a <code>FileItem</code> instance represents
* a simple form field.
@@ -212,7 +196,6 @@ public interface FileItem extends Serial
*/
void setFormField(boolean state);
-
/**
* Returns an {@link java.io.OutputStream OutputStream} that can
* be used for storing the contents of the file.
Modified:
tomcat/trunk/java/org/apache/tomcat/util/http/fileupload/FileItemFactory.java
URL:
http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/tomcat/util/http/fileupload/FileItemFactory.java?rev=1456872&r1=1456871&r2=1456872&view=diff
==============================================================================
---
tomcat/trunk/java/org/apache/tomcat/util/http/fileupload/FileItemFactory.java
(original)
+++
tomcat/trunk/java/org/apache/tomcat/util/http/fileupload/FileItemFactory.java
Fri Mar 15 10:37:13 2013
@@ -16,7 +16,6 @@
*/
package org.apache.tomcat.util.http.fileupload;
-
/**
* <p>A factory interface for creating {@link FileItem} instances. Factories
* can provide their own custom configuration, over and above that provided
@@ -47,4 +46,5 @@ public interface FileItemFactory {
boolean isFormField,
String fileName
);
+
}
Modified:
tomcat/trunk/java/org/apache/tomcat/util/http/fileupload/FileItemHeaders.java
URL:
http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/tomcat/util/http/fileupload/FileItemHeaders.java?rev=1456872&r1=1456871&r2=1456872&view=diff
==============================================================================
---
tomcat/trunk/java/org/apache/tomcat/util/http/fileupload/FileItemHeaders.java
(original)
+++
tomcat/trunk/java/org/apache/tomcat/util/http/fileupload/FileItemHeaders.java
Fri Mar 15 10:37:13 2013
@@ -27,8 +27,10 @@ import java.util.Iterator;
* @since 1.3
*/
public interface FileItemHeaders {
+
/**
* Returns the value of the specified part header as a <code>String</code>.
+ *
* If the part did not include a header of the specified name, this method
* return <code>null</code>. If there are multiple headers with the same
* name, this method returns the first header in the item. The header
Modified:
tomcat/trunk/java/org/apache/tomcat/util/http/fileupload/FileItemHeadersSupport.java
URL:
http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/tomcat/util/http/fileupload/FileItemHeadersSupport.java?rev=1456872&r1=1456871&r2=1456872&view=diff
==============================================================================
---
tomcat/trunk/java/org/apache/tomcat/util/http/fileupload/FileItemHeadersSupport.java
(original)
+++
tomcat/trunk/java/org/apache/tomcat/util/http/fileupload/FileItemHeadersSupport.java
Fri Mar 15 10:37:13 2013
@@ -27,6 +27,7 @@ package org.apache.tomcat.util.http.file
* @see FileItemStream
*/
public interface FileItemHeadersSupport {
+
/**
* Returns the collection of headers defined locally within this item.
*
Modified:
tomcat/trunk/java/org/apache/tomcat/util/http/fileupload/FileItemIterator.java
URL:
http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/tomcat/util/http/fileupload/FileItemIterator.java?rev=1456872&r1=1456871&r2=1456872&view=diff
==============================================================================
---
tomcat/trunk/java/org/apache/tomcat/util/http/fileupload/FileItemIterator.java
(original)
+++
tomcat/trunk/java/org/apache/tomcat/util/http/fileupload/FileItemIterator.java
Fri Mar 15 10:37:13 2013
@@ -15,17 +15,19 @@
* limitations under the License.
*/
package org.apache.tomcat.util.http.fileupload;
-import java.io.IOException;
+import java.io.IOException;
/**
* An iterator, as returned by
* {@link FileUploadBase#getItemIterator(RequestContext)}.
*/
public interface FileItemIterator {
+
/**
* Returns, whether another instance of {@link FileItemStream}
* is available.
+ *
* @throws FileUploadException Parsing or processing the
* file item failed.
* @throws IOException Reading the file item failed.
@@ -36,6 +38,7 @@ public interface FileItemIterator {
/**
* Returns the next available {@link FileItemStream}.
+ *
* @throws java.util.NoSuchElementException No more items are available.
Use
* {@link #hasNext()} to prevent this exception.
* @throws FileUploadException Parsing or processing the
@@ -45,4 +48,5 @@ public interface FileItemIterator {
* access to the next file item.
*/
FileItemStream next() throws FileUploadException, IOException;
+
}
Modified:
tomcat/trunk/java/org/apache/tomcat/util/http/fileupload/FileItemStream.java
URL:
http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/tomcat/util/http/fileupload/FileItemStream.java?rev=1456872&r1=1456871&r2=1456872&view=diff
==============================================================================
---
tomcat/trunk/java/org/apache/tomcat/util/http/fileupload/FileItemStream.java
(original)
+++
tomcat/trunk/java/org/apache/tomcat/util/http/fileupload/FileItemStream.java
Fri Mar 15 10:37:13 2013
@@ -19,7 +19,6 @@ package org.apache.tomcat.util.http.file
import java.io.IOException;
import java.io.InputStream;
-
/**
* <p> This interface provides access to a file or form item that was
* received within a <code>multipart/form-data</code> POST request.
@@ -33,6 +32,7 @@ import java.io.InputStream;
* which hasn't been read so far from the previous data.</p>
*/
public interface FileItemStream extends FileItemHeadersSupport {
+
/**
* This exception is thrown, if an attempt is made to read
* data from the {@link InputStream}, which has been returned
@@ -41,15 +41,19 @@ public interface FileItemStream extends
* iterator, which created the {@link FileItemStream}.
*/
public static class ItemSkippedException extends IOException {
+
/**
* The exceptions serial version UID, which is being used
* when serializing an exception instance.
*/
private static final long serialVersionUID = -7280778431581963740L;
+
}
- /** Creates an {@link InputStream}, which allows to read the
+ /**
+ * Creates an {@link InputStream}, which allows to read the
* items contents.
+ *
* @return The input stream, from which the items data may
* be read.
* @throws IllegalStateException The method was already invoked on
@@ -94,4 +98,5 @@ public interface FileItemStream extends
* field; <code>false</code> if it represents an uploaded file.
*/
boolean isFormField();
+
}
Modified:
tomcat/trunk/java/org/apache/tomcat/util/http/fileupload/FileUpload.java
URL:
http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/tomcat/util/http/fileupload/FileUpload.java?rev=1456872&r1=1456871&r2=1456872&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/tomcat/util/http/fileupload/FileUpload.java
(original)
+++ tomcat/trunk/java/org/apache/tomcat/util/http/fileupload/FileUpload.java
Fri Mar 15 10:37:13 2013
@@ -16,7 +16,6 @@
*/
package org.apache.tomcat.util.http.fileupload;
-
/**
* <p>High level API for processing file uploads.</p>
*
@@ -45,18 +44,17 @@ public class FileUpload
// ----------------------------------------------------------- Data members
-
/**
* The factory to use to create new form items.
*/
private FileItemFactory fileItemFactory;
-
// ----------------------------------------------------------- Constructors
-
/**
- * Constructs an uninitialised instance of this class. A factory must be
+ * Constructs an uninitialised instance of this class.
+ *
+ * A factory must be
* configured, using <code>setFileItemFactory()</code>, before attempting
* to parse requests.
*
@@ -66,7 +64,6 @@ public class FileUpload
super();
}
-
/**
* Constructs an instance of this class which uses the supplied factory to
* create <code>FileItem</code> instances.
@@ -79,10 +76,8 @@ public class FileUpload
this.fileItemFactory = fileItemFactory;
}
-
// ----------------------------------------------------- Property accessors
-
/**
* Returns the factory class used when creating file items.
*
@@ -93,7 +88,6 @@ public class FileUpload
return fileItemFactory;
}
-
/**
* Sets the factory class to use when creating file items.
*
@@ -104,5 +98,4 @@ public class FileUpload
this.fileItemFactory = factory;
}
-
}
Modified:
tomcat/trunk/java/org/apache/tomcat/util/http/fileupload/InvalidFileNameException.java
URL:
http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/tomcat/util/http/fileupload/InvalidFileNameException.java?rev=1456872&r1=1456871&r2=1456872&view=diff
==============================================================================
---
tomcat/trunk/java/org/apache/tomcat/util/http/fileupload/InvalidFileNameException.java
(original)
+++
tomcat/trunk/java/org/apache/tomcat/util/http/fileupload/InvalidFileNameException.java
Fri Mar 15 10:37:13 2013
@@ -16,7 +16,6 @@
*/
package org.apache.tomcat.util.http.fileupload;
-
/**
* This exception is thrown in case of an invalid file name.
* A file name is invalid, if it contains a NUL character.
@@ -28,11 +27,14 @@ package org.apache.tomcat.util.http.file
* character is the string terminator in C.
*/
public class InvalidFileNameException extends RuntimeException {
+
private static final long serialVersionUID = 7922042602454350470L;
+
private final String name;
/**
* Creates a new instance.
+ *
* @param pName The file name causing the exception.
* @param pMessage A human readable error message.
*/
@@ -47,4 +49,5 @@ public class InvalidFileNameException ex
public String getName() {
return name;
}
+
}
Modified:
tomcat/trunk/java/org/apache/tomcat/util/http/fileupload/disk/DiskFileItem.java
URL:
http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/tomcat/util/http/fileupload/disk/DiskFileItem.java?rev=1456872&r1=1456871&r2=1456872&view=diff
==============================================================================
---
tomcat/trunk/java/org/apache/tomcat/util/http/fileupload/disk/DiskFileItem.java
(original)
+++
tomcat/trunk/java/org/apache/tomcat/util/http/fileupload/disk/DiskFileItem.java
Fri Mar 15 10:37:13 2013
@@ -38,7 +38,6 @@ import org.apache.tomcat.util.http.fileu
import org.apache.tomcat.util.http.fileupload.ParameterParser;
import org.apache.tomcat.util.http.fileupload.util.Streams;
-
/**
* <p> The default implementation of the
* {@link org.apache.tomcat.util.http.fileupload.FileItem FileItem} interface.
@@ -88,7 +87,6 @@ public class DiskFileItem
*/
private static final long serialVersionUID = 2237570099615271025L;
-
/**
* Default content charset to be used when no explicit charset
* parameter is provided by the sender. Media subtypes of the
@@ -97,10 +95,8 @@ public class DiskFileItem
*/
public static final String DEFAULT_CHARSET = "ISO-8859-1";
-
// ----------------------------------------------------------- Data members
-
/**
* UID used in unique file name generation.
*/
@@ -113,32 +109,27 @@ public class DiskFileItem
*/
private static int counter = 0;
-
/**
* The name of the form field as provided by the browser.
*/
private String fieldName;
-
/**
* The content type passed by the browser, or <code>null</code> if
* not defined.
*/
private String contentType;
-
/**
* Whether or not this item is a simple form field.
*/
private boolean isFormField;
-
/**
* The original filename in the user's filesystem.
*/
private String fileName;
-
/**
* The size of the item, in bytes. This is used to cache the size when a
* file item is moved from its original location.
@@ -151,19 +142,16 @@ public class DiskFileItem
*/
private int sizeThreshold;
-
/**
* The directory in which uploaded files will be stored, if stored on disk.
*/
private File repository;
-
/**
* Cached contents of the file.
*/
private byte[] cachedContent;
-
/**
* Output stream for this item.
*/
@@ -186,7 +174,6 @@ public class DiskFileItem
// ----------------------------------------------------------- Constructors
-
/**
* Constructs a new <code>DiskFileItem</code> instance.
*
@@ -215,10 +202,8 @@ public class DiskFileItem
this.repository = repository;
}
-
// ------------------------------- Methods from javax.activation.DataSource
-
/**
* Returns an {@link java.io.InputStream InputStream} that can be
* used to retrieve the contents of the file.
@@ -241,7 +226,6 @@ public class DiskFileItem
return new ByteArrayInputStream(cachedContent);
}
-
/**
* Returns the content type passed by the agent or <code>null</code> if
* not defined.
@@ -254,7 +238,6 @@ public class DiskFileItem
return contentType;
}
-
/**
* Returns the content charset passed by the agent or <code>null</code> if
* not defined.
@@ -270,7 +253,6 @@ public class DiskFileItem
return params.get("charset");
}
-
/**
* Returns the original filename in the client's filesystem.
*
@@ -285,10 +267,8 @@ public class DiskFileItem
return Streams.checkFileName(fileName);
}
-
// ------------------------------------------------------- FileItem methods
-
/**
* Provides a hint as to whether or not the file contents will be read
* from memory.
@@ -304,7 +284,6 @@ public class DiskFileItem
return dfos.isInMemory();
}
-
/**
* Returns the size of the file.
*
@@ -323,7 +302,6 @@ public class DiskFileItem
}
}
-
/**
* Returns 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
@@ -361,7 +339,6 @@ public class DiskFileItem
return fileData;
}
-
/**
* Returns the contents of the file as a String, using the specified
* encoding. This method uses {@link #get()} to retrieve the
@@ -380,7 +357,6 @@ public class DiskFileItem
return new String(get(), charset);
}
-
/**
* Returns the contents of the file as a String, using the default
* character encoding. This method uses {@link #get()} to retrieve the
@@ -404,7 +380,6 @@ public class DiskFileItem
}
}
-
/**
* A convenience method to write an uploaded item to disk. The client code
* is not concerned with whether or not the item is stored in memory, or on
@@ -484,7 +459,6 @@ public class DiskFileItem
}
}
-
/**
* Deletes the underlying storage for a file item, including deleting any
* associated temporary disk file. Although this storage will be deleted
@@ -501,7 +475,6 @@ public class DiskFileItem
}
}
-
/**
* Returns the name of the field in the multipart form corresponding to
* this file item.
@@ -516,7 +489,6 @@ public class DiskFileItem
return fieldName;
}
-
/**
* Sets the field name used to reference this file item.
*
@@ -530,7 +502,6 @@ public class DiskFileItem
this.fieldName = fieldName;
}
-
/**
* Determines whether or not a <code>FileItem</code> instance represents
* a simple form field.
@@ -546,7 +517,6 @@ public class DiskFileItem
return isFormField;
}
-
/**
* Specifies whether or not a <code>FileItem</code> instance represents
* a simple form field.
@@ -562,7 +532,6 @@ public class DiskFileItem
isFormField = state;
}
-
/**
* Returns an {@link java.io.OutputStream OutputStream} that can
* be used for storing the contents of the file.
@@ -582,10 +551,8 @@ public class DiskFileItem
return dfos;
}
-
// --------------------------------------------------------- Public methods
-
/**
* Returns the {@link java.io.File} object for the <code>FileItem</code>'s
* data's temporary location on the disk. Note that for
@@ -603,10 +570,8 @@ public class DiskFileItem
return dfos == null ? null : dfos.getFile();
}
-
// ------------------------------------------------------ Protected methods
-
/**
* Removes the file contents from the temporary storage.
*/
@@ -619,7 +584,6 @@ public class DiskFileItem
}
}
-
/**
* Creates and returns a {@link java.io.File File} representing a uniquely
* named temporary file in the configured repository path. The lifetime of
@@ -643,10 +607,8 @@ public class DiskFileItem
return tempFile;
}
-
// -------------------------------------------------------- Private methods
-
/**
* Returns an identifier that is unique within the class loader used to
* load this class, but does not have random-like apearance.
@@ -669,7 +631,6 @@ public class DiskFileItem
return id;
}
-
/**
* Returns a string representation of this object.
*
@@ -688,10 +649,8 @@ public class DiskFileItem
+ this.getFieldName();
}
-
// -------------------------------------------------- Serialization methods
-
/**
* Writes the state of this object during serialization.
*
@@ -756,4 +715,5 @@ public class DiskFileItem
public void setHeaders(FileItemHeaders pHeaders) {
headers = pHeaders;
}
+
}
Modified:
tomcat/trunk/java/org/apache/tomcat/util/http/fileupload/disk/DiskFileItemFactory.java
URL:
http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/tomcat/util/http/fileupload/disk/DiskFileItemFactory.java?rev=1456872&r1=1456871&r2=1456872&view=diff
==============================================================================
---
tomcat/trunk/java/org/apache/tomcat/util/http/fileupload/disk/DiskFileItemFactory.java
(original)
+++
tomcat/trunk/java/org/apache/tomcat/util/http/fileupload/disk/DiskFileItemFactory.java
Fri Mar 15 10:37:13 2013
@@ -22,7 +22,6 @@ import org.apache.tomcat.util.http.fileu
import org.apache.tomcat.util.http.fileupload.FileItem;
import org.apache.tomcat.util.http.fileupload.FileItemFactory;
-
/**
* <p>The default {@link
org.apache.tomcat.util.http.fileupload.FileItemFactory}
* implementation. This implementation creates
@@ -66,28 +65,23 @@ public class DiskFileItemFactory impleme
// ----------------------------------------------------- Manifest constants
-
/**
* The default threshold above which uploads will be stored on disk.
*/
public static final int DEFAULT_SIZE_THRESHOLD = 10240;
-
// ----------------------------------------------------- Instance Variables
-
/**
* The directory in which uploaded files will be stored, if stored on disk.
*/
private File repository;
-
/**
* The threshold above which uploads will be stored on disk.
*/
private int sizeThreshold = DEFAULT_SIZE_THRESHOLD;
-
/**
* <p>The instance of {@link FileCleaningTracker}, which is responsible
* for deleting temporary files.</p>
@@ -97,7 +91,6 @@ public class DiskFileItemFactory impleme
// ----------------------------------------------------------- Constructors
-
/**
* Constructs an unconfigured instance of this class. The resulting factory
* may be configured by calling the appropriate setter methods.
@@ -106,7 +99,6 @@ public class DiskFileItemFactory impleme
this(DEFAULT_SIZE_THRESHOLD, null);
}
-
/**
* Constructs a preconfigured instance of this class.
*
@@ -124,7 +116,6 @@ public class DiskFileItemFactory impleme
// ------------------------------------------------------------- Properties
-
/**
* Returns the directory used to temporarily store files that are larger
* than the configured size threshold.
@@ -138,7 +129,6 @@ public class DiskFileItemFactory impleme
return repository;
}
-
/**
* Sets the directory used to temporarily store files that are larger
* than the configured size threshold.
@@ -152,7 +142,6 @@ public class DiskFileItemFactory impleme
this.repository = repository;
}
-
/**
* Returns the size threshold beyond which files are written directly to
* disk. The default value is 10240 bytes.
@@ -165,7 +154,6 @@ public class DiskFileItemFactory impleme
return sizeThreshold;
}
-
/**
* Sets the size threshold beyond which files are written directly to disk.
*
@@ -178,7 +166,6 @@ public class DiskFileItemFactory impleme
this.sizeThreshold = sizeThreshold;
}
-
// --------------------------------------------------------- Public Methods
/**
@@ -207,7 +194,6 @@ public class DiskFileItemFactory impleme
return result;
}
-
/**
* Returns the tracker, which is responsible for deleting temporary
* files.
@@ -228,4 +214,5 @@ public class DiskFileItemFactory impleme
public void setFileCleaningTracker(FileCleaningTracker pTracker) {
fileCleaningTracker = pTracker;
}
+
}
Modified:
tomcat/trunk/java/org/apache/tomcat/util/http/fileupload/servlet/ServletFileUpload.java
URL:
http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/tomcat/util/http/fileupload/servlet/ServletFileUpload.java?rev=1456872&r1=1456871&r2=1456872&view=diff
==============================================================================
---
tomcat/trunk/java/org/apache/tomcat/util/http/fileupload/servlet/ServletFileUpload.java
(original)
+++
tomcat/trunk/java/org/apache/tomcat/util/http/fileupload/servlet/ServletFileUpload.java
Fri Mar 15 10:37:13 2013
@@ -54,7 +54,6 @@ public class ServletFileUpload extends F
// ---------------------------------------------------------- Class methods
-
/**
* Utility method that determines whether the request contains multipart
* content.
@@ -79,10 +78,8 @@ public class ServletFileUpload extends F
return false;
}
-
// ----------------------------------------------------------- Constructors
-
/**
* Constructs an uninitialised instance of this class. A factory must be
* configured, using <code>setFileItemFactory()</code>, before attempting
@@ -94,7 +91,6 @@ public class ServletFileUpload extends F
super();
}
-
/**
* Constructs an instance of this class which uses the supplied factory to
* create <code>FileItem</code> instances.
@@ -106,10 +102,8 @@ public class ServletFileUpload extends F
super(fileItemFactory);
}
-
// --------------------------------------------------------- Public methods
-
/**
* Processes an <a href="http://www.ietf.org/rfc/rfc1867.txt">RFC 1867</a>
* compliant <code>multipart/form-data</code> stream.
@@ -130,4 +124,5 @@ public class ServletFileUpload extends F
throws FileUploadException, IOException {
return super.getItemIterator(new ServletRequestContext(request));
}
+
}
Modified:
tomcat/trunk/java/org/apache/tomcat/util/http/fileupload/servlet/ServletRequestContext.java
URL:
http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/tomcat/util/http/fileupload/servlet/ServletRequestContext.java?rev=1456872&r1=1456871&r2=1456872&view=diff
==============================================================================
---
tomcat/trunk/java/org/apache/tomcat/util/http/fileupload/servlet/ServletRequestContext.java
(original)
+++
tomcat/trunk/java/org/apache/tomcat/util/http/fileupload/servlet/ServletRequestContext.java
Fri Mar 15 10:37:13 2013
@@ -43,7 +43,6 @@ public class ServletRequestContext imple
*/
private HttpServletRequest request;
-
// ----------------------------------------------------------- Constructors
/**
@@ -55,7 +54,6 @@ public class ServletRequestContext imple
this.request = request;
}
-
// --------------------------------------------------------- Public Methods
/**
@@ -112,4 +110,5 @@ public class ServletRequestContext imple
+ ", ContentType="
+ this.getContentType();
}
+
}
Modified:
tomcat/trunk/java/org/apache/tomcat/util/http/fileupload/util/Closeable.java
URL:
http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/tomcat/util/http/fileupload/util/Closeable.java?rev=1456872&r1=1456871&r2=1456872&view=diff
==============================================================================
---
tomcat/trunk/java/org/apache/tomcat/util/http/fileupload/util/Closeable.java
(original)
+++
tomcat/trunk/java/org/apache/tomcat/util/http/fileupload/util/Closeable.java
Fri Mar 15 10:37:13 2013
@@ -18,21 +18,24 @@ package org.apache.tomcat.util.http.file
import java.io.IOException;
-
/**
* Interface of an object, which may be closed.
*/
public interface Closeable {
+
/**
* Closes the object.
+ *
* @throws IOException An I/O error occurred.
*/
void close() throws IOException;
/**
* Returns, whether the object is already closed.
+ *
* @return True, if the object is closed, otherwise false.
* @throws IOException An I/O error occurred.
*/
boolean isClosed() throws IOException;
+
}
Modified:
tomcat/trunk/java/org/apache/tomcat/util/http/fileupload/util/FileItemHeadersImpl.java
URL:
http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/tomcat/util/http/fileupload/util/FileItemHeadersImpl.java?rev=1456872&r1=1456871&r2=1456872&view=diff
==============================================================================
---
tomcat/trunk/java/org/apache/tomcat/util/http/fileupload/util/FileItemHeadersImpl.java
(original)
+++
tomcat/trunk/java/org/apache/tomcat/util/http/fileupload/util/FileItemHeadersImpl.java
Fri Mar 15 10:37:13 2013
@@ -35,6 +35,7 @@ import org.apache.tomcat.util.http.fileu
* @since 1.3
*/
public class FileItemHeadersImpl implements FileItemHeaders, Serializable {
+
private static final long serialVersionUID = -4455695752627032559L;
/**
@@ -84,4 +85,5 @@ public class FileItemHeadersImpl impleme
}
headerValueList.add(value);
}
+
}
Modified:
tomcat/trunk/java/org/apache/tomcat/util/http/fileupload/util/LimitedInputStream.java
URL:
http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/tomcat/util/http/fileupload/util/LimitedInputStream.java?rev=1456872&r1=1456871&r2=1456872&view=diff
==============================================================================
---
tomcat/trunk/java/org/apache/tomcat/util/http/fileupload/util/LimitedInputStream.java
(original)
+++
tomcat/trunk/java/org/apache/tomcat/util/http/fileupload/util/LimitedInputStream.java
Fri Mar 15 10:37:13 2013
@@ -20,21 +20,22 @@ import java.io.FilterInputStream;
import java.io.IOException;
import java.io.InputStream;
-
/**
* An input stream, which limits its data size. This stream is
* used, if the content length is unknown.
*/
-public abstract class LimitedInputStream
- extends FilterInputStream implements Closeable {
+public abstract class LimitedInputStream extends FilterInputStream implements
Closeable {
+
/**
* The maximum size of an item, in bytes.
*/
private long sizeMax;
+
/**
* The current number of bytes.
*/
private long count;
+
/**
* Whether this stream is already closed.
*/
@@ -42,6 +43,7 @@ public abstract class LimitedInputStream
/**
* Creates a new instance.
+ *
* @param pIn The input stream, which shall be limited.
* @param pSizeMax The limit; no more than this number of bytes
* shall be returned by the source stream.
@@ -54,6 +56,7 @@ public abstract class LimitedInputStream
/**
* Called to indicate, that the input streams limit has
* been exceeded.
+ *
* @param pSizeMax The input streams limit, in bytes.
* @param pCount The actual number of bytes.
* @throws IOException The called method is expected
@@ -62,8 +65,10 @@ public abstract class LimitedInputStream
protected abstract void raiseError(long pSizeMax, long pCount)
throws IOException;
- /** Called to check, whether the input streams
+ /**
+ * Called to check, whether the input streams
* limit is reached.
+ *
* @throws IOException The given limit is exceeded.
*/
private void checkLimit() throws IOException {
@@ -134,6 +139,7 @@ public abstract class LimitedInputStream
/**
* Returns, whether this stream is already closed.
+ *
* @return True, if the stream is closed, otherwise false.
* @throws IOException An I/O error occurred.
*/
@@ -156,4 +162,5 @@ public abstract class LimitedInputStream
closed = true;
super.close();
}
+
}
Modified:
tomcat/trunk/java/org/apache/tomcat/util/http/fileupload/util/Streams.java
URL:
http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/tomcat/util/http/fileupload/util/Streams.java?rev=1456872&r1=1456871&r2=1456872&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/tomcat/util/http/fileupload/util/Streams.java
(original)
+++ tomcat/trunk/java/org/apache/tomcat/util/http/fileupload/util/Streams.java
Fri Mar 15 10:37:13 2013
@@ -23,10 +23,11 @@ import java.io.OutputStream;
import org.apache.tomcat.util.http.fileupload.InvalidFileNameException;
-
-/** Utility class for working with streams.
+/**
+ * Utility class for working with streams.
*/
public final class Streams {
+
/**
* Private constructor, to prevent instantiation.
* This class has only static methods.
@@ -47,6 +48,7 @@ public final class Streams {
* <pre>
* copy(pInputStream, pOutputStream, new byte[8192]);
* </pre>
+ *
* @param pInputStream The input stream, which is being read.
* It is guaranteed, that {@link InputStream#close()} is called
* on the stream.
@@ -70,6 +72,7 @@ public final class Streams {
/**
* Copies the contents of the given {@link InputStream}
* to the given {@link OutputStream}.
+ *
* @param pIn The input stream, which is being read.
* It is guaranteed, that {@link InputStream#close()} is called
* on the stream.
@@ -138,6 +141,7 @@ public final class Streams {
* {@link org.apache.tomcat.util.http.fileupload.FileItemStream}'s
* content into a string. The platform's default character encoding
* is used for converting bytes into characters.
+ *
* @param pStream The input stream to read.
* @see #asString(InputStream, String)
* @return The streams contents, as a string.
@@ -153,6 +157,7 @@ public final class Streams {
* This convenience method allows to read a
* {@link org.apache.tomcat.util.http.fileupload.FileItemStream}'s
* content into a string, using the given character encoding.
+ *
* @param pStream The input stream to read.
* @param pEncoding The character encoding, typically "UTF-8".
* @see #asString(InputStream)
@@ -171,6 +176,7 @@ public final class Streams {
* that it doesn't contain any NUL characters. If the file name
* is valid, it will be returned without any modifications. Otherwise,
* an {@link InvalidFileNameException} is raised.
+ *
* @param pFileName The file name to check
* @return Unmodified file name, if valid.
* @throws InvalidFileNameException The file name was found to be invalid.
@@ -195,4 +201,5 @@ public final class Streams {
}
return pFileName;
}
+
}
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]