Skip to content

Instantly share code, notes, and snippets.

View twolfe18's full-sized avatar

Travis Wolfe twolfe18

  • Google
  • San Francisco
View GitHub Profile
File f = new File("foo.txt");
// You're not allowed to make a Path using raw strings,
// that would be dangerous!
Path p = FileSystems.getDefault().getPath("foo.txt");
// Both of these type check :)
f.getName().endsWith(".txt"); // true
p.getFileName().endsWith(".txt"); // false