View Javadoc
1   //
2   // $Id: FileByFileUploadPolicy.java 822 2009-07-02 14:49:12Z etienne_sf $
3   //
4   // jupload - A file upload applet.
5   // Copyright 2007 The JUpload Team
6   //
7   // Created: 2006-05-06
8   // Creator: etienne_sf
9   // Last modified: $Date: 2009-07-02 16:49:12 +0200 (jeu., 02 juil. 2009) $
10  //
11  // This program is free software; you can redistribute it and/or modify it under
12  // the terms of the GNU General Public License as published by the Free Software
13  // Foundation; either version 2 of the License, or (at your option) any later
14  // version. This program is distributed in the hope that it will be useful, but
15  // WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
16  // FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
17  // details. You should have received a copy of the GNU General Public License
18  // along with this program; if not, write to the Free Software Foundation, Inc.,
19  // 675 Mass Ave, Cambridge, MA 02139, USA.
20  
21  package wjhk.jupload2.policies;
22  
23  import wjhk.jupload2.context.JUploadContext;
24  import wjhk.jupload2.exception.JUploadException;
25  
26  /**
27   * Specialization of
28   * {@link wjhk.jupload2.policies.CustomizedNbFilesPerRequestUploadPolicy}, where
29   * each upload HTTP request contains only one file. <BR>
30   * <BR>
31   * This policy :
32   * <UL>
33   * <LI>Upload files without transformation
34   * <LI>File by file (uploading 5 files needs 5 HTTP request toward the server)
35   * <UL>
36   * <BR>
37   * <BR>
38   * The same behavior can be obtained by specifying no UploadPolicy (or
39   * {@link FileByFileUploadPolicy}), and give the nbFilesPerRequest (with a value
40   * set to 1) parameter.
41   * 
42   * @author etienne_sf
43   * @version $Revision: 822 $
44   * @deprecated You can use the applet, without the uploadPolicy applet
45   *             parameter, and put the nbFilesPerRequest to 1. It does the
46   *             same...
47   * 
48   */
49  @Deprecated
50  public class FileByFileUploadPolicy extends DefaultUploadPolicy {
51  
52      /**
53       * @param juploadContext The applet on which the UploadPolicy should apply.
54       * @throws JUploadException
55       */
56      public FileByFileUploadPolicy(JUploadContext juploadContext)
57              throws JUploadException {
58          super(juploadContext);
59  
60          setNbFilesPerRequest(1);
61      }
62  
63  }