ClassPath.java revision 0
869N/A * Copyright 1994-2007 Sun Microsystems, Inc. All Rights Reserved. 869N/A * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 869N/A * This code is free software; you can redistribute it and/or modify it 869N/A * under the terms of the GNU General Public License version 2 only, as 869N/A * published by the Free Software Foundation. Sun designates this 869N/A * particular file as subject to the "Classpath" exception as provided 869N/A * by Sun in the LICENSE file that accompanied this code. 869N/A * This code is distributed in the hope that it will be useful, but WITHOUT 869N/A * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 869N/A * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 869N/A * version 2 for more details (a copy is included in the LICENSE file that 869N/A * accompanied this code). 869N/A * You should have received a copy of the GNU General Public License version 873N/A * 2 along with this work; if not, write to the Free Software Foundation, 869N/A * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. 869N/A * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, 869N/A * CA 95054 USA or visit www.sun.com if you need additional information or 0N/A * This class is used to represent a class path, which can contain both 869N/A * directories and zip files. 869N/A * WARNING: The contents of this source file are not part of any 869N/A * supported API. Code that depends on them does so at its own risk: 869N/A * they are subject to change or removal without notice. 716N/A * The original class path string 1954N/A * List of class path entries 1954N/A * Build a class path from the specified path string 1954N/A * Build a class path from the specified array of class path 0N/A * element strings. This constructor, and the corresponding 0N/A * "init" method, were added as part of the fix for 6473331, which 869N/A * adds support for Class-Path manifest entries in JAR files to 868N/A * rmic. It is conceivable that the value of a Class-Path 983N/A * manifest entry will contain a path separator, which would cause 1928N/A * incorrect behavior if the expanded path were passed to the 2042N/A * previous constructor as a single path-separator-delimited 1004N/A * string; use of this constructor avoids that problem. 1004N/A * Build a default class path from the path strings specified by 0N/A * the properties sun.boot.class.path and env.class.path, in that 65N/A // Save original class path string 65N/A // Count the number of path separators 65N/A // Build the class path 65N/A for (i = n =
0; i <
len; i = j +
1) {
2266N/A // Ignore exceptions, at least for now... 2266N/A // Trim class path to exact size 2266N/A // Save original class path string 868N/A // Build the class path 869N/A // Ignore exceptions, at least for now... 869N/A // Trim class path to exact size 869N/A * Find the specified directory in the class path 869N/A * Load the specified file from the class path 1155N/A // zip files are picky about "foo" vs. "foo/". 1155N/A // also, the getFiles caches are keyed with a trailing / 0N/A // Don't bother checking !file.isDir, 0N/A // since we only look for names which 2222N/A * Returns list of files given a package name and extension. 868N/A * Returns original class path string 868N/A * A class path entry, which can either be a directory or an open zip file. 1948N/A // search the directory, exactly once 869N/A // should not happen, but just in case, fail silently