Source Code Cross Referenced for FileInput.java in  » Installer » AntInstaller » org » tp23 » antinstaller » input » 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 » AntInstaller » org.tp23.antinstaller.input 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


001:        /* 
002:         * Copyright 2005 Paul Hinds
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:        package org.tp23.antinstaller.input;
017:
018:        import java.io.File;
019:
020:        import org.tp23.antinstaller.InstallerContext;
021:        import org.tp23.antinstaller.ValidationException;
022:
023:        /**
024:         *
025:         * <p>Input type to select a directory </p>
026:         * <p> </p>
027:         * <p>Copyright: Copyright (c) 2004</p>
028:         * <p>Company: tp23</p>
029:         * @author Paul Hinds
030:         * @version $Id: FileInput.java,v 1.2 2007/01/28 10:25:48 teknopaul Exp $
031:         */
032:        public class FileInput extends OSSpecific {
033:
034:            private boolean abort = false;
035:            private String checkExists;
036:
037:            public FileInput() {
038:            }
039:
040:            /**
041:             * Called to validate the user input
042:             */
043:            public boolean validate(InstallerContext ctx)
044:                    throws ValidationException {
045:                if (getInputResult() == null) { // this does not happen
046:                    return false;
047:                }
048:                if (InputField.isTrue(checkExists)) {
049:                    File file = new File(getInputResult());
050:                    if (!file.exists()) {
051:                        return false;
052:                    }
053:                }
054:                return true;
055:            }
056:
057:            public boolean isAbort() {
058:                return abort;
059:            }
060:
061:            public void setAbort(boolean abort) {
062:                this .abort = abort;
063:            }
064:
065:            public String getCheckExists() {
066:                return checkExists;
067:            }
068:
069:            public void setCheckExists(String checkExists) {
070:                this .checkExists = checkExists;
071:            }
072:
073:            public void setValue(String dir) {
074:                setInputResult(dir);
075:            }
076:
077:            /**
078:             * Used by checkConfig to validate the configuration file.
079:             * Not used at runtime.
080:             * @return boolean
081:             */
082:            public boolean validateObject() {
083:                if (getDisplayText() == null) {
084:                    System.out.println("File:displayText must be set");
085:                    return false;
086:                }
087:                if (getProperty() == null) {
088:                    System.out.println("File:property must be set");
089:                    return false;
090:                }
091:                if (getDefaultValue() == null) {
092:                    System.out.println("File:defaultValue must be set");
093:                    return false;
094:                }
095:                if (!InputField.optionalBoolean(getCheckExists())) {
096:                    System.out
097:                            .println("File:checkExists must be true or false or null");
098:                    return false;
099:                }
100:                return true;
101:            }
102:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.