ClassPath.java revision 5516
5516N/A * Copyright (c) 1994, 2012, Oracle and/or its affiliates. All rights reserved. 0N/A * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 0N/A * This code is free software; you can redistribute it and/or modify it 0N/A * under the terms of the GNU General Public License version 2 only, as 2362N/A * published by the Free Software Foundation. Oracle designates this 0N/A * particular file as subject to the "Classpath" exception as provided 2362N/A * by Oracle in the LICENSE file that accompanied this code. 0N/A * This code is distributed in the hope that it will be useful, but WITHOUT 0N/A * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 0N/A * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 0N/A * version 2 for more details (a copy is included in the LICENSE file that 0N/A * accompanied this code). 0N/A * You should have received a copy of the GNU General Public License version 0N/A * 2 along with this work; if not, write to the Free Software Foundation, 0N/A * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. 2362N/A * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA 2362N/A * or visit www.oracle.com if you need additional information or have any 0N/A * This class is used to represent a class path, which can contain both 0N/A * directories and zip files. 0N/A * WARNING: The contents of this source file are not part of any 0N/A * supported API. Code that depends on them does so at its own risk: 0N/A * they are subject to change or removal without notice. 0N/A * The original class path string 0N/A * List of class path entries 0N/A * Build a class path from the specified path string 0N/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 0N/A * adds support for Class-Path manifest entries in JAR files to 0N/A * rmic. It is conceivable that the value of a Class-Path 0N/A * manifest entry will contain a path separator, which would cause 0N/A * incorrect behavior if the expanded path were passed to the 0N/A * previous constructor as a single path-separator-delimited 0N/A * string; use of this constructor avoids that problem. 0N/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 0N/A // Save original class path string 0N/A // Count the number of path separators 0N/A // Build the class path 0N/A for (i = n =
0; i <
len; i = j +
1) {
0N/A // Ignore exceptions, at least for now... 0N/A // Trim class path to exact size 0N/A // Save original class path string 0N/A // Build the class path 0N/A // Ignore exceptions, at least for now... 0N/A // Trim class path to exact size 0N/A * Find the specified directory in the class path 0N/A * Load the specified file from the class path 0N/A // zip files are picky about "foo" vs. "foo/". 0N/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 0N/A * Returns list of files given a package name and extension. 0N/A * Release resources. 0N/A * Returns original class path string 0N/A * A class path entry, which can either be a directory or an open zip file. 0N/A // search the directory, exactly once 0N/A // should not happen, but just in case, fail silently