You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@commons.apache.org by jo...@apache.org on 2009/01/18 03:18:46 UTC
svn commit: r735374 - in /commons/proper/fileupload/trunk: ./ src/changes/
src/java/org/apache/commons/fileupload/
src/java/org/apache/commons/fileupload/disk/ xdocs/
Author: jochen
Date: Sat Jan 17 18:18:45 2009
New Revision: 735374
URL: http://svn.apache.org/viewvc?rev=735374&view=rev
Log:
PR: FILEUPLOAD-155
Submitted-By: Jörg Heinicke <jo...@gmx.de>
Multiple documentation fixes.
Modified:
commons/proper/fileupload/trunk/pom.xml
commons/proper/fileupload/trunk/src/changes/changes.xml
commons/proper/fileupload/trunk/src/java/org/apache/commons/fileupload/MultipartStream.java
commons/proper/fileupload/trunk/src/java/org/apache/commons/fileupload/disk/DiskFileItem.java
commons/proper/fileupload/trunk/src/java/org/apache/commons/fileupload/disk/DiskFileItemFactory.java
commons/proper/fileupload/trunk/xdocs/using.xml
Modified: commons/proper/fileupload/trunk/pom.xml
URL: http://svn.apache.org/viewvc/commons/proper/fileupload/trunk/pom.xml?rev=735374&r1=735373&r2=735374&view=diff
==============================================================================
--- commons/proper/fileupload/trunk/pom.xml (original)
+++ commons/proper/fileupload/trunk/pom.xml Sat Jan 17 18:18:45 2009
@@ -101,6 +101,10 @@
<email>ggregory@seagullsw.com</email>
</contributor>
<contributor>
+ <name>Jörg Heinicke</name>
+ <email>joerg.heinicke@gmx.de</email>
+ </contributor>
+ <contributor>
<name>Stepan Koltsov</name>
<email>yozh@mx1.ru</email>
</contributor>
Modified: commons/proper/fileupload/trunk/src/changes/changes.xml
URL: http://svn.apache.org/viewvc/commons/proper/fileupload/trunk/src/changes/changes.xml?rev=735374&r1=735373&r2=735374&view=diff
==============================================================================
--- commons/proper/fileupload/trunk/src/changes/changes.xml (original)
+++ commons/proper/fileupload/trunk/src/changes/changes.xml Sat Jan 17 18:18:45 2009
@@ -56,6 +56,13 @@
Ensured, that the ProgressListener is called for all
items.
</action>
+ <action dev="jochen" type="fix" issue="FILEUPLOAD-156">
+ Made the ProgressNotifier public.
+ </action>
+ <action dev="jochen" type="fix" issue="FILEUPLOAD-155"
+ due-to="Jörg Heinicke" due-to-email="joerg.heinicke@gmx.de">
+ Multiple documentation fixes.
+ </action>
</release>
<release version="1.2.1" date="2008-01-18">
Modified: commons/proper/fileupload/trunk/src/java/org/apache/commons/fileupload/MultipartStream.java
URL: http://svn.apache.org/viewvc/commons/proper/fileupload/trunk/src/java/org/apache/commons/fileupload/MultipartStream.java?rev=735374&r1=735373&r2=735374&view=diff
==============================================================================
--- commons/proper/fileupload/trunk/src/java/org/apache/commons/fileupload/MultipartStream.java (original)
+++ commons/proper/fileupload/trunk/src/java/org/apache/commons/fileupload/MultipartStream.java Sat Jan 17 18:18:45 2009
@@ -89,7 +89,7 @@
* Internal class, which is used to invoke the
* {@link ProgressListener}.
*/
- static class ProgressNotifier {
+ public static class ProgressNotifier {
/** The listener to invoke.
*/
private final ProgressListener listener;
Modified: commons/proper/fileupload/trunk/src/java/org/apache/commons/fileupload/disk/DiskFileItem.java
URL: http://svn.apache.org/viewvc/commons/proper/fileupload/trunk/src/java/org/apache/commons/fileupload/disk/DiskFileItem.java?rev=735374&r1=735373&r2=735374&view=diff
==============================================================================
--- commons/proper/fileupload/trunk/src/java/org/apache/commons/fileupload/disk/DiskFileItem.java (original)
+++ commons/proper/fileupload/trunk/src/java/org/apache/commons/fileupload/disk/DiskFileItem.java Sat Jan 17 18:18:45 2009
@@ -35,6 +35,7 @@
import org.apache.commons.fileupload.FileItemHeadersSupport;
import org.apache.commons.fileupload.FileUploadException;
import org.apache.commons.fileupload.ParameterParser;
+import org.apache.commons.io.FileCleaningTracker;
import org.apache.commons.io.IOUtils;
import org.apache.commons.io.output.DeferredFileOutputStream;
@@ -52,9 +53,12 @@
* {@link #getInputStream()} and process the file without attempting to load
* it into memory, which may come handy with large files.
*
- * <p>When using the <code>DiskFileItemFactory</code>, then you should
- * consider the following: Temporary files are automatically deleted as
- * soon as they are no longer needed. (More precisely, when the
+ * <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,
+ * then you must consider the following: Temporary files are automatically
+ * deleted as soon as they are no longer needed. (More precisely, when the
* corresponding instance of {@link java.io.File} is garbage collected.)
* This is done by the so-called reaper thread, which is started
* automatically when the class {@link org.apache.commons.io.FileCleaner}
Modified: commons/proper/fileupload/trunk/src/java/org/apache/commons/fileupload/disk/DiskFileItemFactory.java
URL: http://svn.apache.org/viewvc/commons/proper/fileupload/trunk/src/java/org/apache/commons/fileupload/disk/DiskFileItemFactory.java?rev=735374&r1=735373&r2=735374&view=diff
==============================================================================
--- commons/proper/fileupload/trunk/src/java/org/apache/commons/fileupload/disk/DiskFileItemFactory.java (original)
+++ commons/proper/fileupload/trunk/src/java/org/apache/commons/fileupload/disk/DiskFileItemFactory.java Sat Jan 17 18:18:45 2009
@@ -41,15 +41,18 @@
* </ul>
* </p>
*
- * <p>When using the <code>DiskFileItemFactory</code>, then you should
- * consider the following: Temporary files are automatically deleted as
- * soon as they are no longer needed. (More precisely, when the
+ * <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,
+ * then you must consider the following: Temporary files are automatically
+ * deleted as soon as they are no longer needed. (More precisely, when the
* corresponding instance of {@link java.io.File} is garbage collected.)
- * Cleaning up those files is done by an instance of
- * {@link FileCleaningTracker}, and an associated thread. In a complex
- * environment, for example in a web application, you should consider
- * terminating this thread, for example, when your web application
- * ends. See the section on "Resource cleanup"
+ * This is done by the so-called reaper thread, which is started
+ * automatically when the class {@link org.apache.commons.io.FileCleaner}
+ * is loaded.
+ * 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>
*
* @author <a href="mailto:martinc@apache.org">Martin Cooper</a>
@@ -206,20 +209,19 @@
/**
* Returns the tracker, which is responsible for deleting temporary
* files.
- * @return An instance of {@link FileCleaningTracker}, defaults to
- * {@link org.apache.commons.io.FileCleaner#getInstance()}. Null,
- * if temporary files aren't tracked.
+ * @return An instance of {@link FileCleaningTracker}, or null
+ * (default), if temporary files aren't tracked.
*/
public FileCleaningTracker getFileCleaningTracker() {
return fileCleaningTracker;
}
/**
- * Returns the tracker, which is responsible for deleting temporary
+ * Sets the tracker, which is responsible for deleting temporary
* files.
* @param pTracker An instance of {@link FileCleaningTracker},
- * which will from now on track the created files. May be null
- * to disable tracking.
+ * which will from now on track the created files, or null
+ * (default), to disable tracking.
*/
public void setFileCleaningTracker(FileCleaningTracker pTracker) {
fileCleaningTracker = pTracker;
Modified: commons/proper/fileupload/trunk/xdocs/using.xml
URL: http://svn.apache.org/viewvc/commons/proper/fileupload/trunk/xdocs/using.xml?rev=735374&r1=735373&r2=735374&view=diff
==============================================================================
--- commons/proper/fileupload/trunk/xdocs/using.xml (original)
+++ commons/proper/fileupload/trunk/xdocs/using.xml Sat Jan 17 18:18:45 2009
@@ -318,9 +318,11 @@
File repository) {
FileCleaningTracker fileCleaningTracker
= FileCleanerCleanup.getFileCleaningTracker(context);
- return new DiskFileItemFactory(fileCleaningTracker,
- DiskFileItemFactory.DEFAULT_SIZE_THRESHOLD,
- repository);
+ DiskFileItemFactory factory
+ = new DiskFileItemFactory(DiskFileItemFactory.DEFAULT_SIZE_THRESHOLD,
+ repository);
+ factory.setFileCleaningTracker(fileCleaningTracker);
+ return factory;
}
]]></source>
</subsection>