NIO 2 File API: Difference between revisions

From NovaOrdis Knowledge Base
Jump to navigation Jump to search
Line 20: Line 20:
Create a directory hierarchy:
Create a directory hierarchy:
<syntaxhighlight lang='java'>
<syntaxhighlight lang='java'>
Path parent = ...;
Path dir = Files.createDirectories(Paths.get(parent.toString(), "dir1/dir2/dir3"));
</syntaxhighlight>
</syntaxhighlight>

Revision as of 19:33, 19 June 2020

External

Internal

Subjects

Recipes

Create one directory:

Path parent = ...;
Path dir = Files.createDirectory(Paths.get(parent.toString(), "my-dir"));

Create a directory hierarchy:

Path parent = ...;
Path dir = Files.createDirectories(Paths.get(parent.toString(), "dir1/dir2/dir3"));