commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mart...@apache.org
Subject cvs commit: jakarta-commons/fileupload/src/java/org/apache/commons/fileupload DefaultFileItem.java DefaultFileItemFactory.java DeferredFileOutputStream.java DiskFileUpload.java FileUpload.java FileUploadBase.java ThresholdingOutputStream.java
Date Sat, 31 May 2003 22:31:09 GMT
martinc     2003/05/31 15:31:09

  Modified:    fileupload/src/java/org/apache/commons/fileupload
                        DefaultFileItem.java DefaultFileItemFactory.java
                        DeferredFileOutputStream.java DiskFileUpload.java
                        FileUpload.java FileUploadBase.java
                        ThresholdingOutputStream.java
  Log:
  Clean up Checkstyle warnings.
  
  Revision  Changes    Path
  1.19      +9 -12     jakarta-commons/fileupload/src/java/org/apache/commons/fileupload/DefaultFileItem.java
  
  Index: DefaultFileItem.java
  ===================================================================
  RCS file: /home/cvs/jakarta-commons/fileupload/src/java/org/apache/commons/fileupload/DefaultFileItem.java,v
  retrieving revision 1.18
  retrieving revision 1.19
  diff -u -r1.18 -r1.19
  --- DefaultFileItem.java	12 May 2003 05:24:52 -0000	1.18
  +++ DefaultFileItem.java	31 May 2003 22:31:08 -0000	1.19
  @@ -74,9 +74,6 @@
   import java.io.OutputStream;
   import java.io.UnsupportedEncodingException;
   
  -import org.apache.commons.fileupload.FileItem;
  -import org.apache.commons.fileupload.FileUploadException;
  -
   
   /**
    * <p> The default implementation of the
  @@ -204,7 +201,7 @@
        * @return An {@link java.io.InputStream InputStream} that can be
        *         used to retrieve the contents of the file.
        *
  -     * @exception java.io.IOException if an error occurs.
  +     * @exception IOException if an error occurs.
        */
       public InputStream getInputStream()
           throws IOException
  @@ -342,7 +339,7 @@
        *
        * @return The contents of the file, as a string.
        *
  -     * @exception java.io.UnsupportedEncodingException if the requested character
  +     * @exception UnsupportedEncodingException if the requested character
        *                                         encoding is not available.
        */
       public String getString(String encoding)
  @@ -383,7 +380,7 @@
        * @param file The <code>File</code> into which the uploaded item should
        *             be stored.
        *
  -     * @exception java.lang.Exception if an error occurs.
  +     * @exception Exception if an error occurs.
        */
       public void write(File file) throws Exception
       {
  @@ -473,7 +470,7 @@
        * @param file The full path to location where the uploaded file should
        *             be stored.
        *
  -     * @exception java.lang.Exception if an error occurs.
  +     * @exception Exception if an error occurs.
        *
        * @deprecated Use <code>write(File)</code> instead.
        */
  @@ -587,7 +584,7 @@
        * @return An {@link java.io.OutputStream OutputStream} that can be used
        *         for storing the contensts of the file.
        *
  -     * @exception java.io.IOException if an error occurs.
  +     * @exception IOException if an error occurs.
        */
       public OutputStream getOutputStream()
           throws IOException
  
  
  
  1.2       +14 -15    jakarta-commons/fileupload/src/java/org/apache/commons/fileupload/DefaultFileItemFactory.java
  
  Index: DefaultFileItemFactory.java
  ===================================================================
  RCS file: /home/cvs/jakarta-commons/fileupload/src/java/org/apache/commons/fileupload/DefaultFileItemFactory.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- DefaultFileItemFactory.java	27 Apr 2003 17:30:06 -0000	1.1
  +++ DefaultFileItemFactory.java	31 May 2003 22:31:08 -0000	1.2
  @@ -64,17 +64,15 @@
   
   import java.io.File;
   
  -import org.apache.commons.fileupload.FileItem;
  -import org.apache.commons.fileupload.FileItemFactory;
  -import org.apache.commons.fileupload.DefaultFileItem;
  -
   
   /**
  - * <p>The default {@link org.apache.commons.fileupload.FileItemFactory} implementation.
This implementation
  - * creates {@link org.apache.commons.fileupload.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>The default {@link org.apache.commons.fileupload.FileItemFactory}
  + * implementation. This implementation creates
  + * {@link org.apache.commons.fileupload.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:
  @@ -209,8 +207,9 @@
       // --------------------------------------------------------- Public Methods
   
       /**
  -     * Create a new {@link org.apache.commons.fileupload.DefaultFileItem} instance from
the supplied
  -     * parameters and the local factory configuration.
  +     * Create a new {@link org.apache.commons.fileupload.DefaultFileItem}
  +     * instance from the supplied parameters and the local factory
  +     * configuration.
        *
        * @param fieldName   The name of the form field.
        * @param contentType The content type of the form field.
  
  
  
  1.2       +6 -6      jakarta-commons/fileupload/src/java/org/apache/commons/fileupload/DeferredFileOutputStream.java
  
  Index: DeferredFileOutputStream.java
  ===================================================================
  RCS file: /home/cvs/jakarta-commons/fileupload/src/java/org/apache/commons/fileupload/DeferredFileOutputStream.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- DeferredFileOutputStream.java	27 Apr 2003 17:30:06 -0000	1.1
  +++ DeferredFileOutputStream.java	31 May 2003 22:31:08 -0000	1.2
  @@ -142,7 +142,7 @@
        *
        * @return The underlying output stream.
        *
  -     * @exception java.io.IOException if an error occurs.
  +     * @exception IOException if an error occurs.
        */
       protected OutputStream getStream() throws IOException
       {
  @@ -156,7 +156,7 @@
        * much data is being written to keep in memory, so we elect to switch to
        * disk-based storage.
        *
  -     * @exception java.io.IOException if an error occurs.
  +     * @exception IOException if an error occurs.
        */
       protected void thresholdReached() throws IOException
       {
  
  
  
  1.2       +7 -9      jakarta-commons/fileupload/src/java/org/apache/commons/fileupload/DiskFileUpload.java
  
  Index: DiskFileUpload.java
  ===================================================================
  RCS file: /home/cvs/jakarta-commons/fileupload/src/java/org/apache/commons/fileupload/DiskFileUpload.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- DiskFileUpload.java	27 Apr 2003 17:30:06 -0000	1.1
  +++ DiskFileUpload.java	31 May 2003 22:31:08 -0000	1.2
  @@ -101,7 +101,7 @@
       /**
        * The factory to use to create new form items.
        */
  -    protected DefaultFileItemFactory fileItemFactory;
  +    private DefaultFileItemFactory fileItemFactory;
   
   
       // ----------------------------------------------------------- Constructors
  @@ -149,12 +149,10 @@
   
       /**
        * Sets the factory class to use when creating file items. The factory must
  -     * be instance of <code>DefaultFileItemFactory</code> or a subclass thereof.
  +     * be an instance of <code>DefaultFileItemFactory</code> or a subclass
  +     * thereof, or else a <code>ClassCastException</code> will be thrown.
        *
        * @param factory The factory class for new file items.
  -     *
  -     * @exception ClassCastException if the factory is not of an appropriate
  -     *                               type.
        */
       public void setFileItemFactory(FileItemFactory factory)
       {
  
  
  
  1.20      +5 -5      jakarta-commons/fileupload/src/java/org/apache/commons/fileupload/FileUpload.java
  
  Index: FileUpload.java
  ===================================================================
  RCS file: /home/cvs/jakarta-commons/fileupload/src/java/org/apache/commons/fileupload/FileUpload.java,v
  retrieving revision 1.19
  retrieving revision 1.20
  diff -u -r1.19 -r1.20
  --- FileUpload.java	27 Apr 2003 17:30:06 -0000	1.19
  +++ FileUpload.java	31 May 2003 22:31:08 -0000	1.20
  @@ -101,7 +101,7 @@
       /**
        * The factory to use to create new form items.
        */
  -    protected FileItemFactory fileItemFactory;
  +    private FileItemFactory fileItemFactory;
   
   
       // ----------------------------------------------------------- Constructors
  
  
  
  1.2       +6 -6      jakarta-commons/fileupload/src/java/org/apache/commons/fileupload/FileUploadBase.java
  
  Index: FileUploadBase.java
  ===================================================================
  RCS file: /home/cvs/jakarta-commons/fileupload/src/java/org/apache/commons/fileupload/FileUploadBase.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- FileUploadBase.java	27 Apr 2003 17:30:06 -0000	1.1
  +++ FileUploadBase.java	31 May 2003 22:31:08 -0000	1.2
  @@ -185,7 +185,7 @@
        * The maximum size permitted for an uploaded file. A value of -1 indicates
        * no maximum.
        */
  -    protected long sizeMax = -1;
  +    private long sizeMax = -1;
   
   
       // ----------------------------------------------------- Property accessors
  @@ -464,7 +464,7 @@
        *
        * @return A newly created <code>FileItem</code> instance.
        *
  -     * @exception org.apache.commons.fileupload.FileUploadException if an error occurs.
  +     * @exception FileUploadException if an error occurs.
        */
       protected FileItem createItem(Map /* String, String */ headers,
                                     boolean isFormField)
  
  
  
  1.3       +12 -12    jakarta-commons/fileupload/src/java/org/apache/commons/fileupload/ThresholdingOutputStream.java
  
  Index: ThresholdingOutputStream.java
  ===================================================================
  RCS file: /home/cvs/jakarta-commons/fileupload/src/java/org/apache/commons/fileupload/ThresholdingOutputStream.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- ThresholdingOutputStream.java	3 May 2003 04:47:38 -0000	1.2
  +++ ThresholdingOutputStream.java	31 May 2003 22:31:08 -0000	1.3
  @@ -132,7 +132,7 @@
        *
        * @param b The byte to be written.
        *
  -     * @exception java.io.IOException if an error occurs.
  +     * @exception IOException if an error occurs.
        */
       public void write(int b) throws IOException
       {
  @@ -148,7 +148,7 @@
        *
        * @param b The array of bytes to be written.
        *
  -     * @exception java.io.IOException if an error occurs.
  +     * @exception IOException if an error occurs.
        */
       public void write(byte b[]) throws IOException
       {
  @@ -166,7 +166,7 @@
        * @param off The start offset in the byte array.
        * @param len The number of bytes to write.
        *
  -     * @exception java.io.IOException if an error occurs.
  +     * @exception IOException if an error occurs.
        */
       public void write(byte b[], int off, int len) throws IOException
       {
  @@ -180,7 +180,7 @@
        * Flushes this output stream and forces any buffered output bytes to be
        * written out.
        *
  -     * @exception java.io.IOException if an error occurs.
  +     * @exception IOException if an error occurs.
        */
       public void flush() throws IOException
       {
  @@ -192,7 +192,7 @@
        * Closes this output stream and releases any system resources associated
        * with this stream.
        *
  -     * @exception java.io.IOException if an error occurs.
  +     * @exception IOException if an error occurs.
        */
       public void close() throws IOException
       {
  @@ -257,7 +257,7 @@
        * @param count The number of bytes about to be written to the underlying
        *              output stream.
        *
  -     * @exception java.io.IOException if an error occurs.
  +     * @exception IOException if an error occurs.
        */
       protected void checkThreshold(int count) throws IOException
       {
  @@ -278,7 +278,7 @@
        *
        * @return The underlying output stream.
        *
  -     * @exception java.io.IOException if an error occurs.
  +     * @exception IOException if an error occurs.
        */
       protected abstract OutputStream getStream() throws IOException;
   
  @@ -288,7 +288,7 @@
        * subclass should take whatever action necessary on this event. This may
        * include changing the underlying output stream.
        *
  -     * @exception java.io.IOException if an error occurs.
  +     * @exception IOException if an error occurs.
        */
       protected abstract void thresholdReached() throws IOException;
   }
  
  
  

---------------------------------------------------------------------
To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-dev-help@jakarta.apache.org


Mime
View raw message