/*
* 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.
*
* 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.
*/
/**
*
* @author ksrini
*/
/*
* This class contains all the commonly used utilities used by various tests
* in this directory.
*/
class Utils {
static final boolean IsWindows =
static final boolean Is64Bit =
static {
throw new RuntimeException("Error: requires an SDK to run");
}
}
if (VerifierJar.exists()) {
return;
}
classesDir.mkdirs();
try {
for (File f : javaFileList) {
}
} finally {
}
compiler("-d",
"xclasses",
jar("cvfe",
"sun.tools.pack.verify.Main",
"-C",
"xclasses",
".");
}
}
}
init();
}
throws IOException {
init();
}
return new FileFilter() {
return true;
}
return false;
}
};
}
if (pathname.isDirectory()) {
return true;
}
return false;
}
};
return true;
}
return false;
}
};
}
}
}
: name;
}
/*
* Suppose a path is provided which consists of a full path
*/
return null;
}
}
}
}
}
}
for (File f : a) {
}
}
}
}
}
return dirList;
}
} else if (dir.isDirectory()) {
if (entries[i].isDirectory()) {
recursiveDelete(entries[i]);
}
}
}
}
throws IOException {
return list;
}
/*
* finds files in the start directory using the the filter, appends
* the files to the dirList.
*/
}
}
if (c == null) {
return;
}
try {
c.close();
} catch (IOException ignore) {
}
}
throw new RuntimeException("compilation failed");
}
}
throw new RuntimeException("jar command failed");
}
}
// given a jar file foo.jar will write to foo.pack
// Take the time optimization vs. space
// Make the memory consumption as effective as possible
// ignore all JAR deflation requests to save time
// save the file ordering of the original JAR
try {
// Write out to a jtreg scratch area
// Call the packer
} finally {
}
}
// uses java unpacker, slow but useful to discover issues with the packer
throws IOException {
}
// uses native unpacker using the java APIs
throws IOException {
}
// given a packed file, create the jar file in the current directory.
boolean useJavaUnpack) throws IOException {
// Unpack the files
if (useJavaUnpack) {
}
// Call the unpacker
}
byte buf[] = new byte[8192];
try {
while (n > 0) {
}
return baos.toByteArray();
} finally {
}
}
}
return out;
}
}
new ProcessBuilder(cmdsList);
}
}
int retval = 0;
try {
pb.redirectErrorStream(true);
is = p.getInputStream();
}
if (retval != 0) {
throw new RuntimeException("process failed with non-zero exit");
}
} finally {
if (p != null) {
p.destroy();
}
}
return alist;
}
return getAjavaCmd("unpack200");
}
return getAjavaCmd("pack200");
}
return getAjavaCmd("java");
}
if (!unpack200File.canExecute()) {
throw new RuntimeException("please check" +
cmd + " exists and is executable");
}
return cmd;
}
// search the source dir and jdk dir for requested file and returns
// the first location it finds.
try {
if (locaterCache == null) {
}
for (File f : locaterCache) {
return f;
}
}
} catch (IOException e) {
throw new RuntimeException(e);
}
}
}