Lines Matching defs:file

12  * version 2 for more details (a copy is included in the LICENSE file that
26 * @summary Unit test for java.nio.file.Files copy and move methods
33 import java.nio.file.*;
34 import static java.nio.file.Files.*;
35 import static java.nio.file.StandardCopyOption.*;
36 import static java.nio.file.LinkOption.*;
37 import java.nio.file.attribute.*;
54 // a different volume/file system and so improve test coverage.
83 // check file type
127 static Map<String,ByteBuffer> readUserDefinedFileAttributes(Path file)
131 getFileAttributeView(file, UserDefinedFileAttributeView.class);
148 // read attributes before file is moved
154 // get file attributes of source file
166 // hash file contents if regular file
174 // read named attributes if available (and file is not a sym link)
181 // move file
188 // verify file contents
191 throw new RuntimeException("Failed to verify move of regular file");
240 // -- regular file --
243 * Test: move regular file, target does not exist
251 * Test: move regular file, target exists
272 * Test: move regular file, target does not exist
280 * Test: move regular file, target exists
289 * Test: move regular file, target exists and is empty directory
298 * Test: move regular file, target exists and is non-empty directory
315 * Test atomic move of regular file (same file store)
323 * Test atomic move of regular file (different file store)
411 * Test: move non-empty directory (same file system)
421 * Test: move non-empty directory (different file store)
437 * Test atomic move of directory (same file store)
449 * Test: Move symbolic link to file, target does not exist
502 * Test: Move regular file, target exists
546 * Test atomic move of symbolic link (same file store)
604 // get attributes of source and target file to verify copy
619 // check hash if regular file
663 * Tests all possible ways to invoke copy to copy a file to a file
670 // -- regular file --
673 * Test: move regular file, target does not exist
682 * Test: copy regular file, target exists
703 * Test: copy regular file, target does not exist
712 * Test: copy regular file, target exists
722 * Test: copy regular file, target exists and is empty directory
732 * Test: copy regular file, target exists and is non-empty directory
749 * Test: copy regular file + attributes
861 * Test: Copy link (to file)
905 Path unc = Paths.get("\\\\rialto\\share\\file");
950 * Test copy from an input stream to a file
1007 // create source file
1012 // target file might already exist
1017 // copy from stream to file
1033 // check file
1045 * Test copy from file to output stream
1095 // computes simple hash of the given file
1096 static int computeHash(Path file) throws IOException {
1099 try (InputStream in = newInputStream(file)) {
1112 // create file of random size in given directory
1115 Path file = dir.resolve(name);
1116 createFile(file);
1119 try (OutputStream out = newOutputStream(file)) {
1122 randomizeAttributes(file);
1123 return file;
1135 // "randomize" the file attributes of the given file.
1136 static void randomizeAttributes(Path file) throws IOException {
1140 boolean isDirectory = isDirectory(file, NOFOLLOW_LINKS);
1144 getPosixFilePermissions(file, NOFOLLOW_LINKS);
1160 setPosixFilePermissions(file, perms);
1165 getFileAttributeView(file, DosFileAttributeView.class, NOFOLLOW_LINKS);
1171 getFileStore(file).supportsFileAttributeView("xattr");
1178 getFileAttributeView(file, UserDefinedFileAttributeView.class);
1188 // create name for file in given directory