KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > sslexplorer > vfs > UploadDetails


1 /*
2  * SSL-Explorer
3  *
4  * Copyright (C) 2003-2006 3SP LTD. All Rights Reserved
5  *
6  * This program is free software; you can redistribute it and/or
7  * modify it under the terms of the GNU General Public License
8  * as published by the Free Software Foundation; either version 2 of
9  * the License, or (at your option) any later version.
10  * This program is distributed in the hope that it will be useful,
11  * but WITHOUT ANY WARRANTY; without even the implied warranty of
12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13  * GNU General Public License for more details.
14  *
15  * You should have received a copy of the GNU General Public
16  * License along with this program; if not, write to the Free Software
17  * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
18  */

19             
20 package com.sslexplorer.vfs;
21
22 import org.apache.struts.action.ActionForward;
23
24
25 /**
26  * <p>This class holds the details required for a file upload action.
27  *
28  * @author James D Robinson
29  *
30  * @mail <a HREF="mailto:james@3sp.com">&lt;james@3sp.com&gt;</a>
31 */

32 public class UploadDetails {
33     private String JavaDoc acceptTypes;
34     private boolean extract;
35     private String JavaDoc messageKey, errorKey;
36     private String JavaDoc resourcePath;
37     private String JavaDoc type;
38     
39     private String JavaDoc extraAttribute1;
40     private String JavaDoc extraAttribute2;
41     private String JavaDoc extraAttribute3;
42     
43     private ActionForward uploadedForward;
44     private ActionForward doneForward;
45     private ActionForward cancelForward;
46     
47     private String JavaDoc bundle;
48
49     /**
50      * @param bundle the bundle that contains message resources for type
51      * @param type The type of upload
52      * @param uploadedForward Where the upload action is.
53      * @param doneForward The forward to go to after the upload is done.
54      */

55     public UploadDetails(String JavaDoc bundle, String JavaDoc type, ActionForward uploadedForward, ActionForward doneForward) {
56         this(bundle, type, null, uploadedForward, doneForward, null);
57     }
58     
59     /**
60      * @param bundle the bundle that contains message resources for type
61      * @param type The type of upload
62      * @param resourcePath The path of the resource to upload.
63      * @param uploadedForward Where the upload action is.
64      * @param doneForward The forward to go to after the upload is done.
65      * @param cancelForward The forward to return to if the operation is canceled.
66      */

67     public UploadDetails(String JavaDoc bundle, String JavaDoc type, String JavaDoc resourcePath, ActionForward uploadedForward, ActionForward doneForward, ActionForward cancelForward) {
68         this.type = type;
69         this.bundle = bundle;
70         this.resourcePath = resourcePath;
71         this.uploadedForward = uploadedForward;
72         this.doneForward = doneForward;
73         this.cancelForward = cancelForward;
74     }
75     
76     /**
77      * Get the bundle that contains message resources for the type
78      *
79      * @return bundle
80      */

81     public String JavaDoc getBundle() {
82         return bundle;
83     }
84     
85     /**
86      * @return The ActionForwrd to the cancel page.
87      */

88     public ActionForward getCancelForward() {
89         return cancelForward;
90     }
91     
92     /**
93      * @return The ActionForward to go to when the upload is done.
94      */

95     public ActionForward getDoneForward() {
96         return doneForward;
97     }
98     
99     /**
100      * @return The ActionForward to the upload page.
101      */

102     public ActionForward getUploadedForward() {
103         return uploadedForward;
104     }
105
106     /**
107      * @return The type of upload to occur.
108      */

109     public String JavaDoc getType() {
110         return type;
111     }
112
113     /**
114      * @param type Set the type of upload to occur.
115      */

116     public void setType(String JavaDoc type) {
117         this.type = type;
118     }
119
120     /**
121      * @param messageKey Set the message key.
122      */

123     public void setMessageKey(String JavaDoc messageKey) {
124         this.messageKey = messageKey;
125     }
126
127     /**
128      * @return Get the message key.
129      */

130     public String JavaDoc getMessageKey() {
131         return messageKey;
132     }
133
134     /**
135      * @param errorKey Set the error key.
136      */

137     public void setErrorKey(String JavaDoc errorKey) {
138         this.errorKey = errorKey;
139     }
140
141     /**
142      * @return Get the error key.
143      */

144     public String JavaDoc getErrorKey() {
145         return errorKey;
146     }
147
148     /**
149      * @param acceptTypes The accepted types.
150      */

151     public void setAcceptTypes(String JavaDoc acceptTypes) {
152         this.acceptTypes = acceptTypes;
153     }
154
155     /**
156      * @return Get the accept types.
157      */

158     public String JavaDoc getAcceptTypes() {
159         return acceptTypes;
160     }
161
162     /**
163      * @param extract Set weather the upload file is to be exrtacted, i.e. a zip file.
164      */

165     public void setExtract(boolean extract) {
166         this.extract = extract;
167     }
168
169     /**
170      * @return get weather the file is to be extracted.
171      */

172     public boolean getExtract() {
173         return extract;
174     }
175     
176     /**
177      * @param resourcePath Set the path to the resoource to be uploaded.
178      */

179     public void setResourcePath(String JavaDoc resourcePath) {
180         this.resourcePath = resourcePath;
181     }
182     
183     /**
184      * @return Get the path to the resource to be uploaded.
185      */

186     public String JavaDoc getResourcePath() {
187         return resourcePath;
188     }
189
190     /**
191      * @return Get extra attriute1
192      */

193     public String JavaDoc getExtraAttribute1() {
194         return extraAttribute1;
195     }
196
197     /**
198      * @param extraAttribute1 Set extra attribute1
199      */

200     public void setExtraAttribute1(String JavaDoc extraAttribute1) {
201         this.extraAttribute1 = extraAttribute1;
202     }
203
204     /**
205      * @return Get extra attriute2
206      */

207     public String JavaDoc getExtraAttribute2() {
208         return extraAttribute2;
209     }
210
211     /**
212      * @param extraAttribute2 Set extra attrinute2.
213      */

214     public void setExtraAttribute2(String JavaDoc extraAttribute2) {
215         this.extraAttribute2 = extraAttribute2;
216     }
217
218     /**
219      * @return Get extra attrinute3.
220      */

221     public String JavaDoc getExtraAttribute3() {
222         return extraAttribute3;
223     }
224
225     /**
226      * @param extraAttribute3 Set extra attribute3
227      */

228     public void setExtraAttribute3(String JavaDoc extraAttribute3) {
229         this.extraAttribute3 = extraAttribute3;
230     }
231 }
232
Popular Tags