public static final Path create ( Path path , Path target , String perms ) throws IOException { FileAttribute < ? > [ ] attrs = getFileAttributes ( perms ) ; switch ( perms . charAt ( 0 ) ) { case ' ' : return Files . createFile ( path , attrs ) ; case ' ' : if ( target == null ) { throw new IllegalArgumentException ( "no target" ) ; } return Files . createSymbolicLink ( path , target , attrs ) ; case ' ' : return Files . createDirectories ( path , attrs ) ; default : throw new IllegalArgumentException ( perms + " illegal to this method" ) ; } }
Creates regular file directory or symbolic link