Source Code Cross Referenced for ExecutableFile.java in  » Installer » IzPack » com » izforge » izpack » 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 » Installer » IzPack » com.izforge.izpack 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


001:        /*
002:         * IzPack - Copyright 2001-2008 Julien Ponge, All Rights Reserved.
003:         * 
004:         * http://izpack.org/
005:         * http://izpack.codehaus.org/
006:         * 
007:         * Copyright 2001,2002 Olexij Tkatchenko
008:         *
009:         * Licensed under the Apache License, Version 2.0 (the "License");
010:         * you may not use this file except in compliance with the License.
011:         * You may obtain a copy of the License at
012:         * 
013:         *     http://www.apache.org/licenses/LICENSE-2.0
014:         *     
015:         * Unless required by applicable law or agreed to in writing, software
016:         * distributed under the License is distributed on an "AS IS" BASIS,
017:         * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
018:         * See the License for the specific language governing permissions and
019:         * limitations under the License.
020:         */
021:
022:        package com.izforge.izpack;
023:
024:        import com.izforge.izpack.util.OsConstraint;
025:
026:        import java.io.Serializable;
027:        import java.util.ArrayList;
028:        import java.util.List;
029:
030:        /**
031:         * Encloses information about a executable file. This class abstracts the way to do a system
032:         * dependent postprocessing of installation.
033:         * 
034:         * @author Olexij Tkatchenko <ot@parcs.de>
035:         */
036:
037:        public class ExecutableFile implements  Serializable {
038:
039:            static final long serialVersionUID = 4175489415984990405L;
040:
041:            /** when to execute this file */
042:            public final static int POSTINSTALL = 0;
043:
044:            public final static int NEVER = 1;
045:
046:            public final static int UNINSTALL = 2;
047:
048:            /** type of a file */
049:            public final static int BIN = 0;
050:
051:            public final static int JAR = 1;
052:
053:            /** what to do if execution fails */
054:            public final static int ABORT = 0;
055:
056:            public final static int WARN = 1;
057:
058:            public final static int ASK = 2;
059:
060:            public final static int IGNORE = 3;
061:
062:            /** The file path */
063:            public String path;
064:
065:            /** Execution stage (NEVER, POSTINSTALL, UNINSTALL) */
066:            public int executionStage;
067:
068:            /** Main class of jar file */
069:            public String mainClass;
070:
071:            /** type (BIN|JAR) */
072:            public int type;
073:
074:            /** Failure handling (ABORT, WARN, ASK) */
075:            public int onFailure;
076:
077:            /** List of arguments */
078:            public List<String> argList = null;
079:
080:            /** List of operating systems to run on */
081:            public List<OsConstraint> osList = null;
082:
083:            /**
084:             * Indicates the file should be kept after executing. Default is false for backward
085:             * compatibility.
086:             */
087:            public boolean keepFile;
088:
089:            /** condition for this executable */
090:            private String condition = null;
091:
092:            /** Constructs a new uninitialized instance. */
093:            public ExecutableFile() {
094:                this .path = null;
095:                executionStage = NEVER;
096:                mainClass = null;
097:                type = BIN;
098:                onFailure = ASK;
099:                osList = new ArrayList<OsConstraint>();
100:                argList = new ArrayList<String>();
101:                keepFile = false;
102:            }
103:
104:            /**
105:             * Constructs and initializes a new instance.
106:             * 
107:             * @param path the file path
108:             * @param executionStage when to execute
109:             * @param onFailure what to do if execution fails
110:             * @param osList list of operating systems to run on
111:             */
112:            public ExecutableFile(String path, int executionStage,
113:                    int onFailure, List<OsConstraint> osList, boolean keepFile) {
114:                this .path = path;
115:                this .executionStage = executionStage;
116:                this .onFailure = onFailure;
117:                this .osList = osList;
118:                this .keepFile = keepFile;
119:            }
120:
121:            public ExecutableFile(String path, int type, String mainClass,
122:                    int executionStage, int onFailure, List<String> argList,
123:                    List<OsConstraint> osList, boolean keepFile) {
124:                this .path = path;
125:                this .mainClass = mainClass;
126:                this .type = type;
127:                this .executionStage = executionStage;
128:                this .onFailure = onFailure;
129:                this .argList = argList;
130:                this .osList = osList;
131:                this .keepFile = keepFile;
132:            }
133:
134:            public String toString() {
135:                StringBuffer retval = new StringBuffer();
136:                retval.append("path = ").append(path);
137:                retval.append("\n");
138:                retval.append("mainClass = ").append(mainClass);
139:                retval.append("\n");
140:                retval.append("type = ").append(type);
141:                retval.append("\n");
142:                retval.append("executionStage = ").append(executionStage);
143:                retval.append("\n");
144:                retval.append("onFailure = ").append(onFailure);
145:                retval.append("\n");
146:                retval.append("argList: ").append(argList);
147:                retval.append("\n");
148:                if (argList != null) {
149:                    for (String anArgList : argList) {
150:                        retval.append("\targ: ").append(anArgList);
151:                        retval.append("\n");
152:                    }
153:                }
154:                retval.append("\n");
155:                retval.append("osList = ").append(osList);
156:                retval.append("\n");
157:                if (osList != null) {
158:                    for (OsConstraint anOsList : osList) {
159:                        retval.append("\tos: ").append(anOsList);
160:                        retval.append("\n");
161:                    }
162:                }
163:                retval.append("keepFile = ").append(keepFile);
164:                retval.append("\n");
165:                return retval.toString();
166:            }
167:
168:            /**
169:             * @return the condition
170:             */
171:            public String getCondition() {
172:                return this .condition;
173:            }
174:
175:            /**
176:             * @param condition the condition to set
177:             */
178:            public void setCondition(String condition) {
179:                this .condition = condition;
180:            }
181:
182:            public boolean hasCondition() {
183:                return this.condition != null;
184:            }
185:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.