mirror of
https://github.com/openjdk/jdk.git
synced 2025-09-19 10:34:38 +02:00
8261237: remove isClassPathAttributePresent method
Reviewed-by: shade, clanger, redestad, alanb
This commit is contained in:
parent
5183d8ae1e
commit
8ebed28403
1 changed files with 1 additions and 20 deletions
|
@ -1,5 +1,5 @@
|
||||||
/*
|
/*
|
||||||
* Copyright (c) 2005, Oracle and/or its affiliates. All rights reserved.
|
* Copyright (c) 2005, 2021, Oracle and/or its affiliates. All rights reserved.
|
||||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||||
*
|
*
|
||||||
* This code is free software; you can redistribute it and/or modify it
|
* This code is free software; you can redistribute it and/or modify it
|
||||||
|
@ -79,25 +79,6 @@ public class VMSupport {
|
||||||
return serializePropertiesToByteArray(getAgentProperties());
|
return serializePropertiesToByteArray(getAgentProperties());
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
|
||||||
* Returns true if the given JAR file has the Class-Path attribute in the
|
|
||||||
* main section of the JAR manifest. Throws RuntimeException if the given
|
|
||||||
* path is not a JAR file or some other error occurs.
|
|
||||||
*/
|
|
||||||
public static boolean isClassPathAttributePresent(String path) {
|
|
||||||
try {
|
|
||||||
Manifest man = (new JarFile(path)).getManifest();
|
|
||||||
if (man != null) {
|
|
||||||
if (man.getMainAttributes().getValue(Attributes.Name.CLASS_PATH) != null) {
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return false;
|
|
||||||
} catch (IOException ioe) {
|
|
||||||
throw new RuntimeException(ioe.getMessage());
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Return the temporary directory that the VM uses for the attach
|
* Return the temporary directory that the VM uses for the attach
|
||||||
* and perf data files.
|
* and perf data files.
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue