Source Code Cross Referenced for Chmod.java in  » Workflow-Engines » pegasus-2.1.0 » org » griphyn » vdl » util » 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 » Workflow Engines » pegasus 2.1.0 » org.griphyn.vdl.util 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


001:        /*
002:         * Globus Toolkit Public License (GTPL)
003:         *     
004:         * Copyright (c) 1999 University of Chicago and The University of 
005:         * Southern California. All Rights Reserved.
006:         * 
007:         *  1) The "Software", below, refers to the Globus Toolkit (in either
008:         *     source-code, or binary form and accompanying documentation) and a
009:         *     "work based on the Software" means a work based on either the
010:         *     Software, on part of the Software, or on any derivative work of
011:         *     the Software under copyright law: that is, a work containing all
012:         *     or a portion of the Software either verbatim or with
013:         *     modifications.  Each licensee is addressed as "you" or "Licensee."
014:         * 
015:         *  2) The University of Southern California and the University of
016:         *     Chicago as Operator of Argonne National Laboratory are copyright
017:         *     holders in the Software.  The copyright holders and their third
018:         *     party licensors hereby grant Licensee a royalty-free nonexclusive
019:         *     license, subject to the limitations stated herein and
020:         *     U.S. Government license rights.
021:         * 
022:         *  3) A copy or copies of the Software may be given to others, if you
023:         *     meet the following conditions:
024:         * 
025:         *     a) Copies in source code must include the copyright notice and
026:         *        this license.
027:         * 
028:         *     b) Copies in binary form must include the copyright notice and
029:         *        this license in the documentation and/or other materials
030:         *        provided with the copy.
031:         * 
032:         *  4) All advertising materials, journal articles and documentation
033:         *     mentioning features derived from or use of the Software must
034:         *     display the following acknowledgement:
035:         * 
036:         *     "This product includes software developed by and/or derived from
037:         *     the Globus project (http://www.globus.org/)."
038:         * 
039:         *     In the event that the product being advertised includes an intact
040:         *     Globus distribution (with copyright and license included) then
041:         *     this clause is waived.
042:         * 
043:         *  5) You are encouraged to package modifications to the Software
044:         *     separately, as patches to the Software.
045:         * 
046:         *  6) You may make modifications to the Software, however, if you
047:         *     modify a copy or copies of the Software or any portion of it,
048:         *     thus forming a work based on the Software, and give a copy or
049:         *     copies of such work to others, either in source code or binary
050:         *     form, you must meet the following conditions:
051:         * 
052:         *     a) The Software must carry prominent notices stating that you
053:         *        changed specified portions of the Software.
054:         * 
055:         *     b) The Software must display the following acknowledgement:
056:         * 
057:         *        "This product includes software developed by and/or derived
058:         *         from the Globus Project (http://www.globus.org/) to which the
059:         *         U.S. Government retains certain rights."
060:         * 
061:         *  7) You may incorporate the Software or a modified version of the
062:         *     Software into a commercial product, if you meet the following
063:         *     conditions:
064:         * 
065:         *     a) The commercial product or accompanying documentation must
066:         *        display the following acknowledgment:
067:         * 
068:         *        "This product includes software developed by and/or derived
069:         *         from the Globus Project (http://www.globus.org/) to which the
070:         *         U.S. Government retains a paid-up, nonexclusive, irrevocable
071:         *         worldwide license to reproduce, prepare derivative works, and
072:         *         perform publicly and display publicly."
073:         * 
074:         *     b) The user of the commercial product must be given the following
075:         *        notice:
076:         * 
077:         *        "[Commercial product] was prepared, in part, as an account of
078:         *         work sponsored by an agency of the United States Government.
079:         *         Neither the United States, nor the University of Chicago, nor
080:         *         University of Southern California, nor any contributors to
081:         *         the Globus Project or Globus Toolkit nor any of their employees,
082:         *         makes any warranty express or implied, or assumes any legal
083:         *         liability or responsibility for the accuracy, completeness, or
084:         *         usefulness of any information, apparatus, product, or process
085:         *         disclosed, or represents that its use would not infringe
086:         *         privately owned rights.
087:         * 
088:         *         IN NO EVENT WILL THE UNITED STATES, THE UNIVERSITY OF CHICAGO
089:         *         OR THE UNIVERSITY OF SOUTHERN CALIFORNIA OR ANY CONTRIBUTORS
090:         *         TO THE GLOBUS PROJECT OR GLOBUS TOOLKIT BE LIABLE FOR ANY
091:         *         DAMAGES, INCLUDING DIRECT, INCIDENTAL, SPECIAL, OR CONSEQUENTIAL
092:         *         DAMAGES RESULTING FROM EXERCISE OF THIS LICENSE AGREEMENT OR
093:         *         THE USE OF THE [COMMERCIAL PRODUCT]."
094:         * 
095:         *  8) LICENSEE AGREES THAT THE EXPORT OF GOODS AND/OR TECHNICAL DATA
096:         *     FROM THE UNITED STATES MAY REQUIRE SOME FORM OF EXPORT CONTROL
097:         *     LICENSE FROM THE U.S. GOVERNMENT AND THAT FAILURE TO OBTAIN SUCH
098:         *     EXPORT CONTROL LICENSE MAY RESULT IN CRIMINAL LIABILITY UNDER U.S.
099:         *     LAWS.
100:         * 
101:         *  9) Portions of the Software resulted from work developed under a
102:         *     U.S. Government contract and are subject to the following license:
103:         *     the Government is granted for itself and others acting on its
104:         *     behalf a paid-up, nonexclusive, irrevocable worldwide license in
105:         *     this computer software to reproduce, prepare derivative works, and
106:         *     perform publicly and display publicly.
107:         * 
108:         * 10) The Software was prepared, in part, as an account of work
109:         *     sponsored by an agency of the United States Government.  Neither
110:         *     the United States, nor the University of Chicago, nor The
111:         *     University of Southern California, nor any contributors to the
112:         *     Globus Project or Globus Toolkit, nor any of their employees,
113:         *     makes any warranty express or implied, or assumes any legal
114:         *     liability or responsibility for the accuracy, completeness, or
115:         *     usefulness of any information, apparatus, product, or process
116:         *     disclosed, or represents that its use would not infringe privately
117:         *     owned rights.
118:         * 
119:         * 11) IN NO EVENT WILL THE UNITED STATES, THE UNIVERSITY OF CHICAGO OR
120:         *     THE UNIVERSITY OF SOUTHERN CALIFORNIA OR ANY CONTRIBUTORS TO THE
121:         *     GLOBUS PROJECT OR GLOBUS TOOLKIT BE LIABLE FOR ANY DAMAGES,
122:         *     INCLUDING DIRECT, INCIDENTAL, SPECIAL, OR CONSEQUENTIAL DAMAGES
123:         *     RESULTING FROM EXERCISE OF THIS LICENSE AGREEMENT OR THE USE OF
124:         *     THE SOFTWARE.
125:         * 
126:         *                               END OF LICENSE
127:         */
128:
129:        package org.griphyn.vdl.util;
130:
131:        import java.io.*;
132:
133:        /**
134:         * This class changes file permission modes in
135:         * Unix/Linux environment.
136:         *
137:         * @author Jens-S. Vöckler
138:         * @author Yong Zhao
139:         * @version $Revision: 50 $
140:         *
141:         */
142:        public class Chmod {
143:            /**
144:             * Changes file permission to be executable
145:             * @param filename is the name of the file to change permissions,
146:             * it allows wildcard. 
147:             * @param dir is the directory where the file is located.
148:             * @return 0 if successful
149:             */
150:            public static int changePermission(String filename, String dir)
151:                    throws IOException, InterruptedException {
152:                if (System.getProperty("line.separator").equals("\n")
153:                        && System.getProperty("file.separator").equals("/")
154:                        && System.getProperty("path.separator").equals(":")) {
155:                    String[] cmd = new String[3];
156:                    cmd[0] = "/bin/sh";
157:                    cmd[1] = "-c";
158:                    cmd[2] = "chmod +x " + filename;
159:
160:                    Process p;
161:                    if (dir == null)
162:                        p = Runtime.getRuntime().exec(cmd, null, null);
163:                    else
164:                        p = Runtime.getRuntime().exec(cmd, null, new File(dir));
165:                    return p.waitFor();
166:                } else {
167:                    return -1;
168:                }
169:            }
170:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.