--- a/langtools/src/share/classes/com/sun/tools/classfile/ClassFile.java Tue May 28 12:46:10 2013 +0100
+++ b/langtools/src/share/classes/com/sun/tools/classfile/ClassFile.java Tue May 28 17:39:41 2013 +0100
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2007, 2008, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2007, 2013, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -29,6 +29,7 @@
import java.io.FileInputStream;
import java.io.IOException;
import java.io.InputStream;
+import java.nio.file.Path;
import static com.sun.tools.classfile.AccessFlags.*;
@@ -46,6 +47,11 @@
return read(file, new Attribute.Factory());
}
+ public static ClassFile read(Path path)
+ throws IOException, ConstantPoolException {
+ return read(path.toFile(), new Attribute.Factory());
+ }
+
public static ClassFile read(File file, Attribute.Factory attributeFactory)
throws IOException, ConstantPoolException {
FileInputStream in = new FileInputStream(file);