3482N/A * Copyright (c) 1999, 2011, 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 maintain mappings from packages, classes 0N/A * and resources to their enclosing JAR files. Mappings are kept 0N/A * at the package level except for class or resource files that 0N/A * are located at the root directory. URLClassLoader uses the mapping 0N/A * information to determine where to fetch an extension class or 0N/A * @author Zhenghua Li 0N/A * The hash map that maintains mappings from 0N/A * The hash map that maintains mappings from 0N/A * An ordered list of jar file names. 0N/A * The index file name. 3482N/A * true if, and only if, sun.misc.JarIndex.metaInfFilenames is set to true. 3482N/A * If true, the names of the files in META-INF, and its subdirectories, will 3482N/A * be added to the index. Otherwise, just the directory names are added. 0N/A * Constructs a new, empty jar index. 0N/A * Constructs a new index from the specified input stream. 0N/A * @param is the input stream containing the index data 0N/A * Constructs a new index for the specified list of jar files. 0N/A * @param files the list of jar files to construct the index from. 0N/A * Returns the jar index, or <code>null</code> if none. 3570N/A * This single parameter version of the method is retained 3570N/A * for binary compatibility with earlier releases. 3570N/A * @param jar the JAR file to get the index from. 3570N/A * @exception IOException if an I/O error has occurred. 3570N/A * Returns the jar index, or <code>null</code> if none. 0N/A * @param jar the JAR file to get the index from. 0N/A * @exception IOException if an I/O error has occurred. 0N/A /* If metaIndex is not null, check the meta index to see 0N/A // if found, then load the index 0N/A * Returns the jar files that are defined in this index. 0N/A * Add the key, value pair to the hashmap, the value will 0N/A * be put in a linked list which is created if necessary. 0N/A * Returns the list of jar files that are mapped to the file. 0N/A * @param fileName the key of the mapping 0N/A /* try the package name again */ 0N/A * Add the mapping from the specified file to the specified 0N/A * jar file. If there were no mapping for the package of the 0N/A * specified file before, a new linked list will be created, 0N/A * the jar file is added to the list and a new mapping from 0N/A * the package to the jar file list is added to the hashmap. 0N/A * Otherwise, the jar file will be added to the end of the 0N/A * @param fileName the file name 0N/A * @param jarName the jar file that the file is mapped to 0N/A // add the mapping to indexMap 0N/A // add the mapping to jarMap 3482N/A * Same as add(String,String) except that it doesn't strip off from the 3482N/A * last index of '/'. It just adds the filename. 3482N/A // add the mapping to indexMap 3482N/A // add the mapping to jarMap 0N/A * Go through all the jar files and construct the 3482N/A // Skip the META-INF directory, the index, and manifest. 3482N/A // Any files in META-INF/ will be indexed explicitly 3482N/A // Add files under META-INF explicitly so that certain 3482N/A // services, like ServiceLoader, etc, can be located 3482N/A // with greater accuracy. Directories can be skipped 3482N/A // since each file will be added explicitly. 0N/A * Writes the index to the specified OutputStream 0N/A * @param out the output stream 0N/A * @exception IOException if an I/O error has occurred 0N/A /* print out the jar file name */ 0N/A * Reads the index from the specified InputStream. 0N/A * @param is the input stream 0N/A * @exception IOException if an I/O error has occurred 0N/A /* an ordered list of jar file names */ 0N/A /* read until we see a .jar line */ 0N/A * Merges the current index into another index, taking into account 0N/A * the relative path of the current index. 0N/A * @param toIndex The destination index which the current index will 0N/A * @param path The relative path of the this index to the destination