Source Code Cross Referenced for UploadForm.java in  » J2EE » JOnAS-4.8.6 » org » objectweb » jonas » webapp » jonasadmin » deploy » Java Source Code / Java DocumentationJava Source Code and Java Documentation

Java Source Code / Java Documentation
1. 6.0 JDK Core
2. 6.0 JDK Modules
3. 6.0 JDK Modules com.sun
4. 6.0 JDK Modules com.sun.java
5. 6.0 JDK Modules sun
6. 6.0 JDK Platform
7. Ajax
8. Apache Harmony Java SE
9. Aspect oriented
10. Authentication Authorization
11. Blogger System
12. Build
13. Byte Code
14. Cache
15. Chart
16. Chat
17. Code Analyzer
18. Collaboration
19. Content Management System
20. Database Client
21. Database DBMS
22. Database JDBC Connection Pool
23. Database ORM
24. Development
25. EJB Server geronimo
26. EJB Server GlassFish
27. EJB Server JBoss 4.2.1
28. EJB Server resin 3.1.5
29. ERP CRM Financial
30. ESB
31. Forum
32. GIS
33. Graphic Library
34. Groupware
35. HTML Parser
36. IDE
37. IDE Eclipse
38. IDE Netbeans
39. Installer
40. Internationalization Localization
41. Inversion of Control
42. Issue Tracking
43. J2EE
44. JBoss
45. JMS
46. JMX
47. Library
48. Mail Clients
49. Net
50. Parser
51. PDF
52. Portal
53. Profiler
54. Project Management
55. Report
56. RSS RDF
57. Rule Engine
58. Science
59. Scripting
60. Search Engine
61. Security
62. Sevlet Container
63. Source Control
64. Swing Library
65. Template Engine
66. Test Coverage
67. Testing
68. UML
69. Web Crawler
70. Web Framework
71. Web Mail
72. Web Server
73. Web Services
74. Web Services apache cxf 2.0.1
75. Web Services AXIS2
76. Wiki Engine
77. Workflow Engines
78. XML
79. XML UI
Java
Java Tutorial
Java Open Source
Jar File Download
Java Articles
Java Products
Java by API
Photoshop Tutorials
Maya Tutorials
Flash Tutorials
3ds-Max Tutorials
Illustrator Tutorials
GIMP Tutorials
C# / C Sharp
C# / CSharp Tutorial
C# / CSharp Open Source
ASP.Net
ASP.NET Tutorial
JavaScript DHTML
JavaScript Tutorial
JavaScript Reference
HTML / CSS
HTML CSS Reference
C / ANSI-C
C Tutorial
C++
C++ Tutorial
Ruby
PHP
Python
Python Tutorial
Python Open Source
SQL Server / T-SQL
SQL Server / T-SQL Tutorial
Oracle PL / SQL
Oracle PL/SQL Tutorial
PostgreSQL
SQL / MySQL
MySQL Tutorial
VB.Net
VB.Net Tutorial
Flash / Flex / ActionScript
VBA / Excel / Access / Word
XML
XML Tutorial
Microsoft Office PowerPoint 2007 Tutorial
Microsoft Office Excel 2007 Tutorial
Microsoft Office Word 2007 Tutorial
Java Source Code / Java Documentation » J2EE » JOnAS 4.8.6 » org.objectweb.jonas.webapp.jonasadmin.deploy 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


001:        /**
002:         * Copyright 1999-2004 The Apache Software Foundation.
003:         *
004:         * Licensed under the Apache License, Version 2.0 (the "License");
005:         * you may not use this file except in compliance with the License.
006:         * You may obtain a copy of the License at
007:         *
008:         *      http://www.apache.org/licenses/LICENSE-2.0
009:         *
010:         * Unless required by applicable law or agreed to in writing, software
011:         * distributed under the License is distributed on an "AS IS" BASIS,
012:         * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
013:         * See the License for the specific language governing permissions and
014:         * limitations under the License.
015:         *
016:         * --------------------------------------------------------------------------
017:         * $Id: UploadForm.java 7486 2005-10-07 22:30:10Z glapouch $
018:         * --------------------------------------------------------------------------
019:         */package org.objectweb.jonas.webapp.jonasadmin.deploy;
020:
021:        import javax.servlet.http.HttpServletRequest;
022:
023:        import org.apache.struts.action.ActionErrors;
024:        import org.apache.struts.action.ActionForm;
025:        import org.apache.struts.action.ActionMapping;
026:        import org.apache.struts.action.ActionMessage;
027:        import org.apache.struts.action.ActionMessages;
028:        import org.apache.struts.upload.FormFile;
029:        import org.apache.struts.upload.MultipartRequestHandler;
030:
031:        /**
032:         * This class is a placeholder for form values.  In a multipart request, files are represented by
033:         * set and get methods that use the class org.apache.struts.upload.FormFile, an interface with
034:         * basic methods to retrieve file information.  The actual structure of the FormFile is dependant
035:         * on the underlying impelementation of multipart request handling.  The default implementation
036:         * that struts uses is org.apache.struts.upload.CommonsMultipartRequestHandler.
037:         *
038:         * @version $Rev: 7486 $ $Date: 2005-10-07 22:30:10 +0000 (Fri, 07 Oct 2005) $
039:         */
040:        public class UploadForm extends ActionForm {
041:
042:            /**
043:             * The file that the user has uploaded
044:             */
045:            private FormFile uploadedFile;
046:
047:            /**
048:             * Is the current context a domain management action?
049:             */
050:            private boolean isDomain;
051:
052:            /**
053:             * Is the current type of deployment currently configurable?
054:             */
055:            private boolean isConfigurable;
056:
057:            /**
058:             * Overwrite value
059:             */
060:            private boolean overwrite = false;
061:
062:            /**
063:             * Return if the action is a domain management operation.
064:             * @return if the action is a domain management operation.
065:             */
066:            public boolean getIsDomain() {
067:                return this .isDomain;
068:            }
069:
070:            /**
071:             * Sets if the action is a domain management operation.
072:             * @param isDomain if the action is a domain management operation.
073:             */
074:            public void setIsDomain(boolean isDomain) {
075:                this .isDomain = isDomain;
076:            }
077:
078:            /**
079:             * @return a representation of the file the user has uploaded
080:             */
081:            public FormFile getUploadedFile() {
082:                return uploadedFile;
083:            }
084:
085:            /**
086:             * Set a representation of the file the user has uploaded
087:             * @param uploadedFile the file uploaded
088:             */
089:            public void setUploadedFile(FormFile uploadedFile) {
090:                this .uploadedFile = uploadedFile;
091:            }
092:
093:            /**
094:             * Check to make sure the client hasn't exceeded the maximum allowed upload size inside of this
095:             * validate method.
096:             * @param mapping the mapping used to select this instance
097:             * @param request the servlet request we are processing
098:             * @return Errors if it fails
099:             */
100:            public ActionErrors validate(ActionMapping mapping,
101:                    HttpServletRequest request) {
102:
103:                ActionErrors errors = null;
104:                //has the maximum length been exceeded?
105:                Boolean maxLengthExceeded = (Boolean) request
106:                        .getAttribute(MultipartRequestHandler.ATTRIBUTE_MAX_LENGTH_EXCEEDED);
107:
108:                if ((maxLengthExceeded != null)
109:                        && (maxLengthExceeded.booleanValue())) {
110:                    errors = new ActionErrors();
111:                    errors.add(ActionMessages.GLOBAL_MESSAGE,
112:                            new ActionMessage("maxLengthExceeded"));
113:                    errors.add(ActionMessages.GLOBAL_MESSAGE,
114:                            new ActionMessage("maxLengthExplanation"));
115:                }
116:                return errors;
117:
118:            }
119:
120:            /**
121:             * @return true if the file will be overwritten
122:             */
123:            public boolean isOverwrite() {
124:                return overwrite;
125:            }
126:
127:            /**
128:             * Replace the existing file ?
129:             * @param overwrite true/false
130:             */
131:            public void setOverwrite(boolean overwrite) {
132:                this .overwrite = overwrite;
133:            }
134:
135:            /**
136:             * Return if the current deployment type is configurable.
137:             * @return if the current deployment type is configurable.
138:             */
139:            public boolean getIsConfigurable() {
140:                return this .isConfigurable;
141:            }
142:
143:            /**
144:             * Sets if the current deployment type is configurable.
145:             * @param isDomain if current deployment type is configurable.
146:             */
147:            public void setIsConfigurable(boolean isConfigurable) {
148:                this.isConfigurable = isConfigurable;
149:            }
150:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.