Source Code Cross Referenced for StartUpLoader.java in  » Database-Client » PKLite-SQL-Client » com » pk » 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 » Database Client » PKLite SQL Client » com.pk 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


001:        /*
002:         * Created on Mar 14, 2004
003:         *
004:         * To change the template for this generated file go to
005:         * Window>Preferences>Java>Code Generation>Code and Comments
006:         */
007:        package com.pk;
008:
009:        import java.io.File;
010:        import java.io.FilenameFilter;
011:        import java.net.URL;
012:        import java.net.URLClassLoader;
013:
014:        /**
015:         * @author Isabelle
016:         *
017:         * To change the template for this generated type comment go to
018:         * Window>Preferences>Java>Code Generation>Code and Comments
019:         */
020:        public class StartUpLoader {
021:            private static URLClassLoader loader;
022:            static {
023:                //		File libDir = new File("./lib/");
024:                //		File currLib = new File("./");
025:                //		StringBuffer classpath = new StringBuffer();
026:                //		try
027:                //		{
028:                //			String classPathSeparator = System.getProperty("path.separator");
029:                //			File[] libJars = libDir.listFiles(new FilenameFilter()
030:                //			{
031:                //				public boolean accept(File dir, String name)
032:                //				{
033:                //					boolean acceptFile = false;
034:                //					if (name.endsWith(".jar") || name.endsWith(".zip"))
035:                //					{
036:                //						acceptFile = true;
037:                //					}
038:                //					return acceptFile;
039:                //				}
040:                //			});
041:                //			URL tmp[] = new URL[libJars.length + 1];
042:                //			String origPath = null;
043:                //			boolean usesUNC = System.getProperty("os.name").startsWith("Windows");
044:                //			for (int i = 0; i < libJars.length + 1; i++)
045:                //			{
046:                //				if (i < libJars.length)
047:                //				{
048:                //					origPath = libJars[i].getCanonicalPath();
049:                //				}
050:                //				else
051:                //				{
052:                //					origPath = currLib.getCanonicalPath();
053:                //				}
054:                //
055:                //				// allow UNC URLs
056:                //				if (usesUNC)
057:                //				{
058:                //					if (origPath.startsWith("\\\\") && !origPath.startsWith("\\\\\\"))
059:                //					{
060:                //						origPath = "\\\\" + origPath;
061:                //					}
062:                //					else if (origPath.startsWith("//") && !origPath.startsWith("///"))
063:                //					{
064:                //						origPath = "//" + origPath;
065:                //					}
066:                //				}
067:                //				tmp[i] = new URL("file:/" + origPath);
068:                //				classpath.append(origPath);
069:                //			}
070:                //			tmp[tmp.length - 1] = new URL("file:/" + origPath + "/");
071:                //			System.setProperty("java.class.path", System.getProperty("java.class.path") + classPathSeparator + classpath.toString());
072:                //			loader = new URLClassLoader(tmp, null);
073:                //
074:                //		}
075:                //		catch (Exception e)
076:                //		{
077:                //			e.printStackTrace();
078:                //		}
079:
080:            }
081:
082:            public static void main(String[] args) {
083:                File libDir = new File("./lib/");
084:                File currLib = new File("./");
085:                StringBuffer classpath = new StringBuffer();
086:                try {
087:                    String classPathSeparator = System
088:                            .getProperty("path.separator");
089:                    File[] libJars = libDir.listFiles(new FilenameFilter() {
090:                        public boolean accept(File dir, String name) {
091:                            boolean acceptFile = false;
092:                            if (name.endsWith(".jar") || name.endsWith(".zip")) {
093:                                acceptFile = true;
094:                            }
095:                            return acceptFile;
096:                        }
097:                    });
098:                    URL tmp[] = new URL[libJars.length + 1];
099:                    String origPath = null;
100:                    boolean usesUNC = System.getProperty("os.name").startsWith(
101:                            "Windows");
102:                    for (int i = 0; i < libJars.length + 1; i++) {
103:
104:                        if (i < libJars.length) {
105:                            origPath = libJars[i].getAbsolutePath();
106:                        } else {
107:                            origPath = currLib.getAbsolutePath();
108:                        }
109:                        // allow UNC URLs
110:
111:                        if (usesUNC) {
112:                            if (origPath.startsWith("\\\\")
113:                                    && !origPath.startsWith("\\\\\\")) {
114:                                origPath = "\\\\" + origPath;
115:                            } else if (origPath.startsWith("//")
116:                                    && !origPath.startsWith("///")) {
117:                                origPath = "//" + origPath;
118:                            }
119:                        }
120:                        tmp[i] = new URL("file:" + origPath);
121:                        classpath.append(origPath);
122:                    }
123:                    tmp[tmp.length - 1] = new URL("file:/" + origPath + "/");
124:                    System.setProperty("java.class.path", System
125:                            .getProperty("java.class.path")
126:                            + classPathSeparator + classpath.toString());
127:                    loader = new URLClassLoader(tmp, null);
128:                } catch (Exception e) {
129:                    e.printStackTrace();
130:                }
131:
132:                Thread.currentThread().setContextClassLoader(loader);
133:                Class tmp2;
134:                try {
135:                    tmp2 = loader.loadClass("com.pk.PrettyKid");
136:                    tmp2.newInstance();
137:                } catch (Exception e) {
138:                    e.printStackTrace();
139:                }
140:            }
141:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.