Source Code Cross Referenced for AccessControlList.java in  » Installer » IzPack » com » coi » tools » os » win » 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.coi.tools.os.win 
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 2006 Klaus Bartz
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.coi.tools.os.win;
023:
024:        import java.util.ArrayList;
025:
026:        /**
027:         * Data container for access control lists used by the registry stuff in the java and in the native
028:         * part. DO NOT CHANGE METHODE SIGNATURES etc. without addapt the native methods
029:         * RegistryImpl.modifyKeyACL and RegistryImpl.getKeyACL.
030:         * 
031:         * @author Klaus Bartz
032:         * 
033:         */
034:        public class AccessControlList extends java.util.ArrayList {
035:
036:            /**
037:             * Required (serializable)
038:             */
039:            private static final long serialVersionUID = -5350586385078554562L;
040:            private ArrayList<AccessControlEntry> permissions = new ArrayList<AccessControlEntry>();
041:
042:            /**
043:             * Default constructor.
044:             */
045:            public AccessControlList() {
046:                super ();
047:            }
048:
049:            /**
050:             * Creates an ACE entry in the permission array with the given values.
051:             * 
052:             * @param owner owner of the ACE
053:             * @param allowed access allowed mask
054:             * @param denied access denied mask
055:             */
056:            public void setACE(String owner, int allowed, int denied) {
057:                AccessControlEntry ace = new AccessControlEntry(owner, allowed,
058:                        denied);
059:                permissions.add(ace);
060:            }
061:
062:            /**
063:             * Returns the access control entry related to the given id.
064:             * 
065:             * @param num id in the internal permisson array.
066:             * @return the access control entry for the given id
067:             */
068:            public AccessControlEntry getACE(int num) {
069:                return ((AccessControlEntry) ((permissions.get(num)).clone()));
070:            }
071:
072:            /**
073:             * Returns number of access control entries.
074:             * 
075:             * @return number of access control entries
076:             */
077:            public int getACECount() {
078:                return (permissions.size());
079:            }
080:
081:            /**
082:             * This class holds a representation of MS Windows ACEs.
083:             * 
084:             * @author Klaus Bartz
085:             * 
086:             */
087:            public static class AccessControlEntry implements  Cloneable {
088:
089:                private String owner;
090:
091:                private int accessAllowdMask;
092:
093:                private int accessDeniedMask;
094:
095:                /**
096:                 * Default constructor.
097:                 */
098:                public AccessControlEntry() {
099:                    super ();
100:                }
101:
102:                /**
103:                 * Creates an ACE with the given parameter.
104:                 * 
105:                 * @param owner2 owner of the ACE
106:                 * @param allowed access allowed mask
107:                 * @param denied access denied mask
108:                 */
109:                public AccessControlEntry(String owner2, int allowed, int denied) {
110:                    owner = owner2;
111:                    accessAllowdMask = allowed;
112:                    accessDeniedMask = denied;
113:                }
114:
115:                /**
116:                 * Returns the owner.
117:                 * 
118:                 * @return the owner
119:                 */
120:                public String getOwner() {
121:                    return owner;
122:                }
123:
124:                /**
125:                 * Sets owner to the given value.
126:                 * 
127:                 * @param owner The owner to set.
128:                 */
129:                public void setOwner(String owner) {
130:                    this .owner = owner;
131:                }
132:
133:                /**
134:                 * Returns the accessAllowdMask.
135:                 * 
136:                 * @return the accessAllowdMask
137:                 */
138:                public int getAccessAllowdMask() {
139:                    return accessAllowdMask;
140:                }
141:
142:                /**
143:                 * Sets accessAllowdMask to the given value.
144:                 * 
145:                 * @param accessAllowdMask The accessAllowdMask to set.
146:                 */
147:                public void setAccessAllowdMask(int accessAllowdMask) {
148:                    this .accessAllowdMask = accessAllowdMask;
149:                }
150:
151:                /**
152:                 * Returns the accessDeniedMask.
153:                 * 
154:                 * @return the accessDeniedMask
155:                 */
156:                public int getAccessDeniedMask() {
157:                    return accessDeniedMask;
158:                }
159:
160:                /**
161:                 * Sets accessDeniedMask to the given value.
162:                 * 
163:                 * @param accessDeniedMask The accessDeniedMask to set.
164:                 */
165:                public void setAccessDeniedMask(int accessDeniedMask) {
166:                    this .accessDeniedMask = accessDeniedMask;
167:                }
168:
169:                /*
170:                 * (non-Javadoc)
171:                 * 
172:                 * @see java.lang.Object#clone()
173:                 */
174:                public Object clone() {
175:                    try {
176:                        return (super .clone());
177:                    } catch (CloneNotSupportedException e) {
178:                        e.printStackTrace();
179:                    }
180:                    return (null);
181:                }
182:            }
183:
184:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.