Family Day update

This commit is contained in:
Ingy döt Net 2020-02-17 23:21:07 -08:00
parent aac6731f2c
commit 9ad63ea473
2442 changed files with 39761 additions and 8255 deletions

View file

@ -0,0 +1,12 @@
package rosetta;
import java.io.IOException;
import java.nio.file.Files;
import java.nio.file.Path;
public class UnixLS {
public static void main(String[] args) throws IOException {
Files.list(Path.of("")).sorted().forEach(System.out::println);
}
}

View file

@ -0,0 +1 @@
Files.list(Path.of("")).map(Path::toString).sorted(String.CASE_INSENSITIVE_ORDER).forEach(System.out::println);

View file

@ -1,22 +0,0 @@
package rosetta;
import java.io.IOException;
import java.io.PrintStream;
import java.nio.file.DirectoryStream;
import java.nio.file.Files;
import java.nio.file.Path;
import java.nio.file.Paths;
public class UnixLS {
public static void main(String[] args) throws IOException {
UnixLS ls = new UnixLS();
ls.list(System.out);
}
private void list(PrintStream out) throws IOException {
try (DirectoryStream<Path> stream = Files.newDirectoryStream(Paths.get("."))) {
stream.forEach((path) -> out.println(path.getFileName()));
}
}
}