@@ -758,14 +758,15 @@ public static Path createDirectories(Path dir, FileAttribute<?>... attrs)
758758 // parent may not exist or other reason
759759 }
760760 SecurityException se = null ;
761+ Path absDir = dir ;
761762 try {
762- dir = dir .toAbsolutePath ();
763+ absDir = dir .toAbsolutePath ();
763764 } catch (SecurityException x ) {
764765 // don't have permission to get absolute path
765766 se = x ;
766767 }
767768 // find a descendant that exists
768- Path parent = dir .getParent ();
769+ Path parent = absDir .getParent ();
769770 while (parent != null ) {
770771 try {
771772 provider (parent ).checkAccess (parent );
@@ -778,7 +779,7 @@ public static Path createDirectories(Path dir, FileAttribute<?>... attrs)
778779 if (parent == null ) {
779780 // unable to find existing parent
780781 if (se == null ) {
781- throw new FileSystemException (dir .toString (), null ,
782+ throw new FileSystemException (absDir .toString (), null ,
782783 "Unable to determine if root directory exists" );
783784 } else {
784785 throw se ;
@@ -787,7 +788,7 @@ public static Path createDirectories(Path dir, FileAttribute<?>... attrs)
787788
788789 // create directories
789790 Path child = parent ;
790- for (Path name : parent .relativize (dir )) {
791+ for (Path name : parent .relativize (absDir )) {
791792 child = child .resolve (name );
792793 createAndCheckIsDirectory (child , attrs );
793794 }
0 commit comments