提交 c530dd2a 编写于 作者: D dxu

8023430: Replace File.mkdirs with Files.createDirectories to get MaxPathLength.java failure details

Reviewed-by: alanb
上级 a555ec44
...@@ -208,7 +208,7 @@ sun/net/www/http/HttpClient/ProxyTest.java generic-all ...@@ -208,7 +208,7 @@ sun/net/www/http/HttpClient/ProxyTest.java generic-all
# jdk_io # jdk_io
# 7160013 # 7160013
java/io/File/MaxPathLength.java windows-all #java/io/File/MaxPathLength.java windows-all
############################################################################ ############################################################################
......
/* /*
* Copyright (c) 2002, 2012, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 2002, 2013, 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
...@@ -27,6 +27,7 @@ ...@@ -27,6 +27,7 @@
*/ */
import java.io.*; import java.io.*;
import java.nio.file.Files;
public class MaxPathLength { public class MaxPathLength {
private static String sep = File.separator; private static String sep = File.separator;
...@@ -87,10 +88,8 @@ public class MaxPathLength { ...@@ -87,10 +88,8 @@ public class MaxPathLength {
System.err.println("Warning: Test directory structure exists already!"); System.err.println("Warning: Test directory structure exists already!");
return; return;
} }
boolean couldMakeTestDirectory = dirFile.mkdirs(); Files.createDirectories(dirFile.toPath());
if (!couldMakeTestDirectory) {
throw new RuntimeException ("Could not create test directory structure");
}
try { try {
if (tryAbsolute) if (tryAbsolute)
dirFile = new File(dirFile.getCanonicalPath()); dirFile = new File(dirFile.getCanonicalPath());
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册