Lines Matching defs:dir
38 static void checkInDirectory(Path file, Path dir) {
39 if (dir == null)
40 dir = Paths.get(System.getProperty("java.io.tmpdir"));
41 if (!file.getParent().equals(dir))
45 static void testTempFile(String prefix, String suffix, Path dir)
48 Path file = (dir == null) ?
50 Files.createTempFile(dir, prefix, suffix);
62 checkInDirectory(file, dir);
88 static void testTempDirectory(String prefix, Path dir) throws IOException {
89 Path subdir = (dir == null) ?
91 Files.createTempDirectory(dir, prefix);
99 checkInDirectory(subdir, dir);
154 Path dir = Files.createTempDirectory("tmpdir");
156 testTempFile("blah", ".dat", dir);
157 testTempFile("blah", null, dir);
158 testTempFile(null, ".dat", dir);
159 testTempFile(null, null, dir);
160 testTempDirectory("blah", dir);
161 testTempDirectory(null, dir);
163 Files.delete(dir);
168 testInvalidFileTemp("dir/blah", null);