/*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation. Oracle designates this
* particular file as subject to the "Classpath" exception as provided
* by Oracle in the LICENSE file that accompanied this code.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
/**
* This class is used by the system to launch the main application.
Launcher */
public class Launcher {
return launcher;
}
public Launcher() {
// Create the extension class loader
try {
} catch (IOException e) {
throw new InternalError(
"Could not create extension class loader");
}
// Now create the class loader to use to launch the application
try {
} catch (IOException e) {
throw new InternalError(
"Could not create application class loader");
}
// Also set the context class loader for the primordial thread.
// Finally, install a security manager if requested
if (s != null) {
} else {
try {
} catch (IllegalAccessException e) {
} catch (InstantiationException e) {
} catch (ClassNotFoundException e) {
} catch (ClassCastException e) {
}
}
} else {
throw new InternalError(
"Could not create SecurityManager: " + s);
}
}
}
/*
* Returns the class loader used to launch the main application.
*/
return loader;
}
/*
* The class loader used for loading installed extensions.
*/
static {
}
/**
* create an ExtClassLoader. The ExtClassLoader is created
* within a context that limits which files it can read
*/
{
try {
// Prior implementations of this doPrivileged() block supplied
// aa synthesized ACC via a call to the private method
// ExtClassLoader.getContext().
return AccessController.doPrivileged(
new PrivilegedExceptionAction<ExtClassLoader>() {
for (int i = 0; i < len; i++) {
}
return new ExtClassLoader(dirs);
}
});
throw (IOException) e.getException();
}
}
}
/*
* Creates a new ExtClassLoader for the specified directories.
*/
}
if (s != null) {
for (int i = 0; i < count; i++) {
}
} else {
}
return dirs;
}
}
}
}
}
return ua;
}
/*
* Searches the installed extension directories for the specified
* library name. For each extension directory, we first look for
* the native library in the subdirectory whose name is the value
* of the system property <code>os.arch</code>. Failing that, we
* look in the extension directory itself.
*/
// Get the ext directory from the URL
// Look in architecture-specific subdirectory first
// Read from the saved system properties to avoid deadlock
return file.getAbsolutePath();
}
}
// Then check the extension directory
return file.getAbsolutePath();
}
}
}
return null;
}
throws IOException
{
new PathPermissions(dirs);
perms);
return acc;
}
}
/**
* The class loader used for loading from java.class.path.
* runs in a restricted security context.
*/
static {
}
throws IOException
{
// Note: on bugid 4256530
// Prior implementations of this doPrivileged() block supplied
// a rather restrictive ACC via a call to the private method
// AppClassLoader.getContext(). This proved overly restrictive
// when loading classes. Specifically it prevent
// accessClassInPackage.sun.* grants from being honored.
//
return AccessController.doPrivileged(
new PrivilegedAction<AppClassLoader>() {
public AppClassLoader run() {
}
});
}
/*
* Creates a new AppClassLoader
*/
}
/**
* Override loadClass so we can checkPackageAccess.
*/
throws ClassNotFoundException
{
if (i != -1) {
}
}
}
/**
* allow any classes loaded from classpath to exit the VM.
*/
{
return perms;
}
/**
* This class loader supports dynamic additions to the class path
* at runtime.
*
* @see java.lang.instrument.Instrumentation#appendToSystemClassPathSearch
*/
// addURL is a no-op if path already contains the URL
}
/**
* create a context that can read any directories (recursively)
* mentioned in the class path. In the case of a jar, it has to
* be the directory containing the jar, not just the jar, as jar
* files might refer to other jar files.
*/
{
new PathPermissions(cp);
perms);
return acc;
}
}
private static class BootClassPathHolder {
static {
if (bootClassPath != null) {
new PrivilegedAction<URL[]>() {
for (int i = 0; i < len; i++) {
// Negative test used to properly handle
// nonexistent jars on boot class path
if (!curEntry.isDirectory()) {
}
}
}
return pathToURLs(classPath);
}
}
);
} else {
}
}
}
return BootClassPathHolder.bcp;
}
}
// DEBUG
//for (int i = 0; i < urls.length; i++) {
// System.out.println("urls[" + i + "] = " + '"' + urls[i] + '"');
//}
return urls;
}
// Count the number of separators first
maxCount++;
}
// Now scan for each path component
} else {
// empty path component translates to "."
}
}
// Make sure we include the last path component
} else {
}
// Trim array to correct size
}
} else {
}
// DEBUG
//for (int i = 0; i < path.length; i++) {
// System.out.println("path[" + i + "] = " + '"' + path[i] + '"');
//}
return path;
}
try {
} catch (IOException e) {}
try {
} catch (MalformedURLException e) {
// Should never happen since we specify the protocol...
throw new InternalError();
}
}
/*
* The stream handler factory for loading system protocol handlers.
*/
try {
return (URLStreamHandler)c.newInstance();
} catch (ClassNotFoundException e) {
e.printStackTrace();
} catch (InstantiationException e) {
e.printStackTrace();
} catch (IllegalAccessException e) {
e.printStackTrace();
}
"system protocol handler");
}
}
}
// use serialVersionUID from JDK 1.2.2 for interoperability
{
}
{
return codeBase;
}
throw new SecurityException("attempt to add a permission");
}
private synchronized void init()
{
return;
perms = new Permissions();
// this is needed to be able to create the classloader itself!
// add permission to read any "java.*" property
try {
path = f.getCanonicalPath();
} catch (IOException ioe) {
path = f.getAbsolutePath();
}
if (i == 0) {
}
if (f.isDirectory()) {
} else {
}
} else {
if (endIndex != -1) {
} else {
// XXX?
}
}
}
return null;
}
});
}
init();
}
init();
synchronized (perms) {
}
}
init();
}
}