Source Code Cross Referenced for PathInfo.java in  » ERP-CRM-Financial » sakai » org » sakaiproject » tool » assessment » settings » 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 » ERP CRM Financial » sakai » org.sakaiproject.tool.assessment.settings 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


001:        /**********************************************************************************
002:         * $URL: https://source.sakaiproject.org/svn/sam/tags/sakai_2-4-1/samigo-app/src/java/org/sakaiproject/tool/assessment/settings/PathInfo.java $
003:         * $Id: PathInfo.java 17056 2006-10-11 16:29:51Z ktsao@stanford.edu $
004:         ***********************************************************************************
005:         *
006:         * Copyright (c) 2004, 2005, 2006 The Sakai Foundation.
007:         *
008:         * Licensed under the Educational Community License, Version 1.0 (the"License");
009:         * you may not use this file except in compliance with the License.
010:         * You may obtain a copy of the License at
011:         *
012:         *      http://www.opensource.org/licenses/ecl1.php
013:         *
014:         * Unless required by applicable law or agreed to in writing, software
015:         * distributed under the License is distributed on an "AS IS" BASIS,
016:         * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
017:         * See the License for the specific language governing permissions and
018:         * limitations under the License.
019:         *
020:         **********************************************************************************/package org.sakaiproject.tool.assessment.settings;
021:
022:        import java.io.FileInputStream;
023:        import java.io.IOException;
024:        import java.util.Properties;
025:
026:        import org.apache.commons.logging.Log;
027:        import org.apache.commons.logging.LogFactory;
028:
029:        /**
030:         * Utility class used for accessing settings and security directories
031:         * (and associated Properties).
032:         *
033:         * @author <a href="mailto:lance@indiana.edu">Lance Speelmon</a>
034:         * @version $Id: PathInfo.java 17056 2006-10-11 16:29:51Z ktsao@stanford.edu $
035:         */
036:        public class PathInfo
037:        //extends AbstractCompositeObject
038:        {
039:            private static Log log = LogFactory.getLog(OjbConfigListener.class);
040:            private static final String SETTINGS_DIR = "/org/sakaiproject/settings/sam";
041:            private static final String SECURITY_DIR = "/org/sakaiproject/security/sam";
042:            private static PathInfo _INSTANCE = new PathInfo();
043:            private String basePathToSecurity = "";
044:            private String basePathToSettings = "";
045:            private String pathToSecurity = "";
046:            private String pathToSettings = "";
047:
048:            /**
049:             * Returns an instance of PathInfo.
050:             *
051:             * @return
052:             */
053:            public static PathInfo getInstance() {
054:                log.debug("getInstance()");
055:
056:                return _INSTANCE;
057:            }
058:
059:            /**
060:             * Constructor should never be exposed.  Singleton pattern.
061:             */
062:            private PathInfo() {
063:                log.debug("new PathInfo()");
064:            }
065:
066:            /**
067:             * Returns a Properties from the security directory.
068:             *
069:             * @param fileName
070:             *
071:             * @return
072:             *
073:             * @throws IOException
074:             */
075:            public Properties getSecurityProperties(String fileName)
076:                    throws IOException {
077:                if (log.isDebugEnabled()) {
078:                    log.debug("getSecurityProperties(String " + fileName + ")");
079:                }
080:
081:                Properties props = null;
082:                props = new Properties();
083:                props
084:                        .load(new FileInputStream(pathToSecurity + "/"
085:                                + fileName));
086:
087:                return props;
088:            }
089:
090:            /**
091:             * DOCUMENTATION PENDING
092:             *
093:             * @param fileName DOCUMENTATION PENDING
094:             *
095:             * @return DOCUMENTATION PENDING
096:             *
097:             * @throws IOException DOCUMENTATION PENDING
098:             */
099:            public Properties getSettingsProperties(String fileName)
100:                    throws IOException {
101:                if (log.isDebugEnabled()) {
102:                    log.debug("getSettingsProperties(String " + fileName + ")");
103:                }
104:
105:                Properties props = null;
106:                props = new Properties();
107:                props
108:                        .load(new FileInputStream(pathToSettings + "/"
109:                                + fileName));
110:
111:                return props;
112:            }
113:
114:            /**
115:             * DOCUMENTATION PENDING
116:             *
117:             * @return DOCUMENTATION PENDING
118:             */
119:            public String getBasePathToSecurity() {
120:                log.debug("getBasePathToSecurity()");
121:
122:                return basePathToSecurity;
123:            }
124:
125:            /**
126:             * DOCUMENTATION PENDING
127:             *
128:             * @param basePathToSecurity DOCUMENTATION PENDING
129:             *
130:             * @throws IllegalArgumentException DOCUMENTATION PENDING
131:             */
132:            public void setBasePathToSecurity(String basePathToSecurity)
133:                    throws IllegalArgumentException {
134:                if (log.isDebugEnabled()) {
135:                    log.debug("setBasePathToSecurity(String "
136:                            + basePathToSecurity + ")");
137:                }
138:
139:                if (basePathToSecurity == null) {
140:                    throw new IllegalArgumentException(
141:                            "basePathToSecurity is null");
142:                }
143:
144:                synchronized (this .basePathToSecurity) {
145:                    this .basePathToSecurity = basePathToSecurity;
146:                }
147:
148:                synchronized (this .pathToSecurity) {
149:                    this .pathToSecurity = this .basePathToSecurity
150:                            + SECURITY_DIR;
151:                }
152:            }
153:
154:            /**
155:             * DOCUMENTATION PENDING
156:             *
157:             * @return DOCUMENTATION PENDING
158:             */
159:            public String getBasePathToSettings() {
160:                log.debug("getBasePathToSettings()");
161:
162:                return basePathToSettings;
163:            }
164:
165:            /**
166:             * DOCUMENTATION PENDING
167:             *
168:             * @param basePathToSettings DOCUMENTATION PENDING
169:             *
170:             * @throws IllegalArgumentException DOCUMENTATION PENDING
171:             */
172:            public void setBasePathToSettings(String basePathToSettings)
173:                    throws IllegalArgumentException {
174:                if (log.isDebugEnabled()) {
175:                    log.debug("setBasePathToSettings(String "
176:                            + basePathToSettings + ")");
177:                }
178:
179:                if (basePathToSettings == null) {
180:                    throw new IllegalArgumentException(
181:                            "basePathToSettings is null");
182:                }
183:
184:                synchronized (this .basePathToSettings) {
185:                    this .basePathToSettings = basePathToSettings;
186:                }
187:
188:                synchronized (this .pathToSettings) {
189:                    this .pathToSettings = this .basePathToSettings
190:                            + SETTINGS_DIR;
191:                }
192:            }
193:
194:            /**
195:             * DOCUMENT ME!
196:             *
197:             * @return
198:             */
199:            public String getPathToSecurity() {
200:                return pathToSecurity;
201:            }
202:
203:            /**
204:             * DOCUMENT ME!
205:             *
206:             * @return
207:             */
208:            public String getPathToSettings() {
209:                return pathToSettings;
210:            }
211:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.