3261N/A * Copyright (c) 1996, 2010, 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/*****************************************************************************/ 0N/A/* Copyright (c) IBM Corporation 1998 */ 0N/A/* (C) Copyright IBM Corp. 1998 */ 0N/A/*****************************************************************************/ 0N/A * BatchEnvironment for rmic extends javac's version in four ways: 0N/A * 1. It overrides errorString() to handle looking for rmic-specific 0N/A * error messages in rmic's resource bundle 0N/A * 2. It provides a mechanism for recording intermediate generated 0N/A * files so that they can be deleted later. 0N/A * 3. It holds a reference to the Main instance so that generators 0N/A * 4. It provides access to the ClassPath passed to the constructor. 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 /** instance of Main which created this environment */ 0N/A * Create a ClassPath object for rmic from a class path string. 0N/A * Create a ClassPath object for rmic from the relevant command line 0N/A * options for class path, boot class path, and extension directories. 0N/A * Previously, this method delegated to the 0N/A * to supply default values for paths not specified on the 0N/A * command line, expand extensions directories into specific 0N/A * JAR files, and construct the ClassPath object-- but as part 0N/A * of the fix for 6473331, which adds support for Class-Path 0N/A * manifest entries in JAR files, those steps are now handled 0N/A * here directly, with the help of a Path utility class copied 0N/A * from the new javac implementation (see below). 0N/A * Class-Path manifest entries are supported for JAR files 0N/A * everywhere except in the boot class path. 0N/A * In the application class path, an empty element means 0N/A * the current working directory. 0N/A // The env.class.path property is the user's CLASSPATH 0N/A // environment variable, and it set by the wrapper (ie, 0N/A * Create a BatchEnvironment for rmic with the given class path, 0N/A * stream for messages and Main. 0N/A // use empty "sourcePath" (see 4666958) 0N/A * Get the instance of Main which created this environment. 0N/A * Get the ClassPath. 0N/A /** list of generated source files created in this environment */ 0N/A * Remember a generated source file generated so that it 0N/A * can be removed later, if appropriate. 0N/A * Delete all the generated source files made during the execution 0N/A * of this environment (those that have been registered with the 0N/A * "addGeneratedFile" method). 0N/A * Release resources, if any. 0N/A * Return the formatted, localized string for a named error message 0N/A * and supplied arguments. For rmic error messages, with names that 0N/A * being with "rmic.", look up the error message in rmic's resource 0N/A * bundle; otherwise, defer to java's superclass method. 0N/A * Utility for building paths of directories and JAR files. This 0N/A * the fix for 6473331, which adds support for Class-Path manifest 0N/A * entries in JAR files. Diagnostic code is simply commented out 0N/A * because rmic silently ignored these conditions historically. 0N/A private static final boolean warn =
false;
0N/A // required for Collection. 0N/A /** Is this the name of a zip file? */ 0N/A /** What to use when path element is the empty string */ 0N/A// log.warning(Position.NOPOS, 0N/A// "dir.path.element.not.found", dir); 0N/A /* Discard duplicates and avoid infinite recursion */ 0N/A /* No such file or directory exist */ 0N/A// log.warning(Position.NOPOS, 0N/A// "path.element.not.found", file); 0N/A /* File is an ordinay file */ 0N/A /* File name don't have right extension */ 0N/A// log.warning(Position.NOPOS, 0N/A// "invalid.archive.file", file); 0N/A /* Now what we have left is either a directory or a file name 0N/A confirming to archive naming convention */ 0N/A // Adds referenced classpath elements from a jar's Class-Path 0N/A // Manifest entry. In some future release, we may want to 0N/A // update this code to recognize URLs rather than simple 0N/A // filenames, but if we do, we should redo all path-related code. 0N/A// log.error(Position.NOPOS, 0N/A// "error.reading.file", jarFileName, 0N/A// e.getLocalizedMessage());