/libcore/ojluni/src/test/java/nio/file/attribute/ |
D | PosixFileAttributeViewTest.java | 32 package test.java.nio.file.attribute; 34 import test.java.nio.file.TestUtil; 36 import java.nio.file.*; 37 import static java.nio.file.LinkOption.*; 38 import java.nio.file.attribute.*; 54 static void testPermissions(Path file, String mode) throws IOException { in testPermissions() argument 59 Files.setPosixFilePermissions(file, perms); in testPermissions() 60 Set<PosixFilePermission> current = Files.getPosixFilePermissions(file); in testPermissions() 68 Files.setAttribute(file, "posix:permissions", perms); in testPermissions() 69 current = (Set<PosixFilePermission>)Files.getAttribute(file, "posix:permissions"); in testPermissions() [all …]
|
D | BasicFileAttributeViewCreationTimeTest.java | 33 package test.java.nio.file.attribute; 35 import test.java.nio.file.TestUtil; 37 import java.nio.file.Path; 38 import java.nio.file.Files; 39 import java.nio.file.attribute.*; 51 private static FileTime creationTime(Path file) throws IOException { in creationTime() argument 52 return Files.readAttributes(file, BasicFileAttributes.class).creationTime(); in creationTime() 58 private static void setCreationTime(Path file, FileTime time) throws IOException { in setCreationTime() argument 60 Files.getFileAttributeView(file, BasicFileAttributeView.class); in setCreationTime() 65 Path file = Files.createFile(top.resolve("foo")); in test() local [all …]
|
D | BasicFileAttributeViewTest.java | 32 package test.java.nio.file.attribute; 34 import test.java.nio.file.TestUtil; 36 import java.nio.file.*; 37 import java.nio.file.attribute.*; 65 static void checkAttributesOfFile(Path dir, Path file) in checkAttributesOfFile() argument 68 BasicFileAttributes attrs = Files.readAttributes(file, BasicFileAttributes.class); in checkAttributesOfFile() 75 File f = new File(file.toString()); in checkAttributesOfFile() 83 Files.getFileAttributeView(file, BasicFileAttributeView.class); in checkAttributesOfFile() 111 Path file = dir.resolve("foo"); in attributeReadWriteTests() local 112 try (OutputStream out = Files.newOutputStream(file)) { in attributeReadWriteTests() [all …]
|
/libcore/ojluni/annotations/hiddenapi/java/nio/file/ |
D | FileTreeWalker.java | 26 package java.nio.file; 31 FileTreeWalker(java.util.Collection<java.nio.file.FileVisitOption> options, int maxDepth) { in FileTreeWalker() 35 private java.nio.file.attribute.BasicFileAttributes getAttributes( in getAttributes() 36 java.nio.file.Path file, boolean canUseCached) throws java.io.IOException { in getAttributes() argument 40 private boolean wouldLoop(java.nio.file.Path dir, java.lang.Object key) { in wouldLoop() 44 private java.nio.file.FileTreeWalker.Event visit( in visit() 45 java.nio.file.Path entry, boolean ignoreSecurityException, boolean canUseCached) { in visit() 49 java.nio.file.FileTreeWalker.Event walk(java.nio.file.Path file) { in walk() argument 53 java.nio.file.FileTreeWalker.Event next() { in next() 82 private final java.nio.file.LinkOption[] linkOptions; [all …]
|
/libcore/ojluni/src/main/java/sun/nio/fs/ |
D | UnixSecureDirectoryStream.java | 28 import java.nio.file.*; 29 import java.nio.file.attribute.*; 108 UnixPath file = getName(obj); in newDirectoryStream() local 109 UnixPath child = ds.directory().resolve(file); in newDirectoryStream() 131 newdfd1 = openat(dfd, file.asByteArray(), flags , 0); in newDirectoryStream() 140 throw new NotDirectoryException(file.toString()); in newDirectoryStream() 141 x.rethrowAsIOException(file); in newDirectoryStream() 158 UnixPath file = getName(obj); in newByteChannel() local 164 String pathToCheck = ds.directory().resolve(file).getPathForPermissionCheck(); in newByteChannel() 171 return UnixChannelFactory.newFileChannel(dfd, file, pathToCheck, options, mode); in newByteChannel() [all …]
|
D | UnixFileAttributeViews.java | 28 import java.nio.file.*; 29 import java.nio.file.attribute.*; 39 protected final UnixPath file; field in UnixFileAttributeViews.Basic 42 Basic(UnixPath file, boolean followLinks) { in Basic() argument 43 this.file = file; in Basic() 49 file.checkRead(); in readAttributes() 52 UnixFileAttributes.get(file, followLinks); in readAttributes() 55 x.rethrowAsIOException(file); in readAttributes() 72 file.checkWrite(); in setTimes() 74 int fd = file.openForAttributeAccess(followLinks); in setTimes() [all …]
|
D | UnixException.java | 28 import java.nio.file.*; 77 private IOException translateToIOException(String file, String other) { in translateToIOException() argument 84 return new AccessDeniedException(file, other, null); in translateToIOException() 86 return new NoSuchFileException(file, other, null); in translateToIOException() 88 return new FileAlreadyExistsException(file, other, null); in translateToIOException() 91 return new FileSystemException(file, other, errorString()); in translateToIOException() 94 void rethrowAsIOException(String file) throws IOException { in rethrowAsIOException() argument 95 IOException x = translateToIOException(file, null); in rethrowAsIOException() 99 void rethrowAsIOException(UnixPath file, UnixPath other) throws IOException { in rethrowAsIOException() argument 100 String a = (file == null) ? null : file.getPathForExceptionMessage(); in rethrowAsIOException() [all …]
|
D | AbstractFileSystemProvider.java | 28 import java.nio.file.*; 29 import java.nio.file.spi.FileSystemProvider; 62 abstract DynamicFileAttributeView getFileAttributeView(Path file, in getFileAttributeView() argument 67 public final void setAttribute(Path file, in setAttribute() argument 76 DynamicFileAttributeView view = getFileAttributeView(file, s[0], options); in setAttribute() 83 …public final Map<String,Object> readAttributes(Path file, String attributes, LinkOption... options) in readAttributes() argument 89 DynamicFileAttributeView view = getFileAttributeView(file, s[0], options); in readAttributes() 99 abstract boolean implDelete(Path file, boolean failIfNotExists) throws IOException; in implDelete() argument 102 public final void delete(Path file) throws IOException { in delete() argument 103 implDelete(file, true); in delete() [all …]
|
D | UnixFileSystemProvider.java | 28 import java.nio.file.*; 29 import java.nio.file.attribute.*; 30 import java.nio.file.spi.FileTypeDetector; 115 UnixPath file = UnixPath.toUnixPath(obj); in getFileAttributeView() local 118 return (V) UnixFileAttributeViews.createBasicView(file, followLinks); in getFileAttributeView() 120 return (V) UnixFileAttributeViews.createPosixView(file, followLinks); in getFileAttributeView() 122 return (V) UnixFileAttributeViews.createOwnerView(file, followLinks); in getFileAttributeView() 130 public <A extends BasicFileAttributes> A readAttributes(Path file, in readAttributes() argument 144 return (A) getFileAttributeView(file, view, options).readAttributes(); in readAttributes() 152 UnixPath file = UnixPath.toUnixPath(obj); in getFileAttributeView() local [all …]
|
D | LinuxUserDefinedFileAttributeView.java | 28 import java.nio.file.*; 52 private byte[] nameAsBytes(UnixPath file, String name) throws IOException { in nameAsBytes() argument 58 throw new FileSystemException(file.getPathForExceptionMessage(), in nameAsBytes() 91 private final UnixPath file; field in LinuxUserDefinedFileAttributeView 94 LinuxUserDefinedFileAttributeView(UnixPath file, boolean followLinks) { in LinuxUserDefinedFileAttributeView() argument 95 this.file = file; in LinuxUserDefinedFileAttributeView() 102 checkAccess(file.getPathForPermissionCheck(), true, false); in list() 104 int fd = file.openForAttributeAccess(followLinks); in list() 123 throw new FileSystemException(file.getPathForExceptionMessage(), in list() 138 checkAccess(file.getPathForPermissionCheck(), true, false); in size() [all …]
|
D | UnixFileStore.java | 28 import java.nio.file.*; 29 import java.nio.file.attribute.*; 44 private final UnixPath file; field in UnixFileStore 53 private static long devFor(UnixPath file) throws IOException { in devFor() argument 55 return UnixFileAttributes.get(file, true).dev(); in devFor() 57 x.rethrowAsIOException(file); in devFor() 62 UnixFileStore(UnixPath file) throws IOException { in UnixFileStore() argument 63 this.file = file; in UnixFileStore() 64 this.dev = devFor(file); in UnixFileStore() 69 this.file = new UnixPath(fs, entry.dir()); in UnixFileStore() [all …]
|
/libcore/ojluni/src/main/java/java/nio/file/ |
D | FileSystemException.java | 26 package java.nio.file; 42 private final String file; field in FileSystemException 53 public FileSystemException(String file) { in FileSystemException() argument 55 this.file = file; in FileSystemException() 72 public FileSystemException(String file, String other, String reason) { in FileSystemException() argument 74 this.file = file; in FileSystemException() 84 return file; in getFile() 110 if (file == null && other == null) in getMessage() 113 if (file != null) in getMessage() 114 sb.append(file); in getMessage()
|
D | FileTreeWalker.java | 26 package java.nio.file; 28 import java.nio.file.attribute.BasicFileAttributes; 129 private final Path file; field in FileTreeWalker.Event 133 private Event(EventType type, Path file, BasicFileAttributes attrs, IOException ioe) { in Event() argument 135 this.file = file; in Event() 140 Event(EventType type, Path file, BasicFileAttributes attrs) { in Event() argument 141 this(type, file, attrs, null); in Event() 144 Event(EventType type, Path file, IOException ioe) { in Event() argument 145 this(type, file, null, ioe); in Event() 152 Path file() { in file() method in FileTreeWalker.Event [all …]
|
/libcore/ojluni/src/main/java/java/lang/ |
D | ProcessBuilder.java | 537 public File file() { return null; } in file() method in ProcessBuilder.Redirect 560 public static Redirect from(final File file) { in from() argument 561 if (file == null) in from() 565 public File file() { return file; } in from() method in ProcessBuilder.Redirect 567 return "redirect to read from file \"" + file + "\""; in from() 587 public static Redirect to(final File file) { in to() argument 588 if (file == null) in to() 592 public File file() { return file; } in to() method 594 return "redirect to write to file \"" + file + "\""; in to() 618 public static Redirect appendTo(final File file) { [all …]
|
/libcore/luni/src/test/java/libcore/java/io/ |
D | RandomAccessFileTest.java | 34 private File file; field in RandomAccessFileTest 37 file = File.createTempFile("RandomAccessFileTest", "tmp"); in setUp() 41 file.delete(); in tearDown() 45 try (RandomAccessFile raf = new RandomAccessFile(file, "rw")) { in testSetLengthTooLarge() 55 try (RandomAccessFile raf = new RandomAccessFile(file, "rw")) { in testSetLength64() 57 assertEquals(0, file.length()); in testSetLength64() 60 assertEquals(moreThanFourGig, file.length()); in testSetLength64() 66 File file = File.createTempFile("RandomAccessFileTest", "tmp"); in testRandomAccessFileHasCleanupFinalizer() local 67 try (RandomAccessFile accessFile = new RandomAccessFile(file, "rw")) { in testRandomAccessFileHasCleanupFinalizer() 74 RandomAccessFile raf = new RandomAccessFile(file, "rw"); in testCloseRaf_sameChannelReturned() [all …]
|
/libcore/harmony-tests/src/test/java/org/apache/harmony/tests/java/io/ |
D | OpenRandomFileTest.java | 37 File file = File.createTempFile("test", "tmp"); in testOpenNonEmptyFile() local 38 assertTrue(file.exists()); in testOpenNonEmptyFile() 39 file.deleteOnExit(); in testOpenNonEmptyFile() 40 FileOutputStream fos = new FileOutputStream(file); in testOpenNonEmptyFile() 44 String fileName = file.getCanonicalPath(); in testOpenNonEmptyFile() 50 File file = File.createTempFile("test", "tmp"); in testOpenEmptyFile() local 51 assertTrue(file.exists()); in testOpenEmptyFile() 52 file.deleteOnExit(); in testOpenEmptyFile() 54 String fileName = file.getCanonicalPath(); in testOpenEmptyFile()
|
/libcore/harmony-tests/src/test/java/org/apache/harmony/tests/java/util/jar/ |
D | JarFileTest.java | 168 File file = Support_Resources.copyFile(resources, null, jarName); in test_ConstructorLjava_io_File() local 169 JarFile jarFile = new JarFile(file); in test_ConstructorLjava_io_File() 188 File file = Support_Resources.copyFile(resources, null, jarName); in test_ConstructorLjava_lang_String() local 189 String fileName = file.getCanonicalPath(); in test_ConstructorLjava_lang_String() 209 File file = Support_Resources.copyFile(resources, null, jarName); in test_ConstructorLjava_lang_StringZ() local 210 String fileName = file.getCanonicalPath(); in test_ConstructorLjava_lang_StringZ() 230 File file = Support_Resources.copyFile(resources, null, jarName); in test_ConstructorLjava_io_FileZ() local 231 JarFile jarFile = new JarFile(file, false); in test_ConstructorLjava_io_FileZ() 251 File file = Support_Resources.copyFile(resources, null, jarName); in test_ConstructorLjava_io_FileZI() local 252 JarFile jarFile = new JarFile(file, false, ZipFile.OPEN_READ); in test_ConstructorLjava_io_FileZI() [all …]
|
/libcore/ojluni/src/main/java/java/net/ |
D | URL.java | 188 private String file; field in URL 313 public URL(String protocol, String host, int port, String file) in URL() argument 316 this(protocol, host, port, file, null); in URL() 337 public URL(String protocol, String host, String file) in URL() argument 339 this(protocol, host, -1, file); in URL() 381 public URL(String protocol, String host, int port, String file, in URL() argument 414 Parts parts = new Parts(file, host); in URL() 419 this.file = path + "?" + query; in URL() 421 this.file = path; in URL() 594 file = context.file; in URL() [all …]
|
/libcore/ojluni/src/test/java/nio/file/ |
D | TestUtil.java | 25 package test.java.nio.file; 27 import java.nio.file.*; 28 import java.nio.file.attribute.BasicFileAttributes; 52 public FileVisitResult visitFile(Path file, BasicFileAttributes attrs) { in removeAll() 54 Files.delete(file); in removeAll() 56 System.err.format("Unable to delete %s: %s\n", file, x); in removeAll() 70 public FileVisitResult visitFileFailed(Path file, IOException exc) { in removeAll() 71 System.err.format("Unable to visit %s: %s\n", file, exc); in removeAll() 77 static public void deleteUnchecked(Path file) { in deleteUnchecked() argument 79 Files.delete(file); in deleteUnchecked() [all …]
|
/libcore/luni/src/test/java/libcore/libcore/io/ |
D | MemoryMappedFileTest.java | 56 File file = createFile(bytes); in testMmapRo_emptyFile() local 58 MemoryMappedFile.mmapRO(file.getPath()); in testMmapRo_emptyFile() 63 file.delete(); in testMmapRo_emptyFile() 69 File file = createFile(bytes); in testMmapRo() local 70 try (MemoryMappedFile memoryMappedFile = MemoryMappedFile.mmapRO(file.getPath())) { in testMmapRo() 73 file.delete(); in testMmapRo() 79 File file = createFile(bytes); in testMmapRo_close() local 80 MemoryMappedFile memoryMappedFile = MemoryMappedFile.mmapRO(file.getPath()); in testMmapRo_close() 101 File file = createFile(bytes); in testReadAfterCloseFails() local 102 MemoryMappedFile memoryMappedFile = MemoryMappedFile.mmapRO(file.getPath()); in testReadAfterCloseFails() [all …]
|
/libcore/luni/src/test/java/libcore/java/nio/file/ |
D | WatchServiceTest.java | 16 package libcore.java.nio.file; 23 import java.nio.file.FileSystems; 24 import java.nio.file.Files; 25 import java.nio.file.Path; 26 import java.nio.file.Paths; 27 import java.nio.file.WatchEvent; 28 import java.nio.file.WatchKey; 29 import java.nio.file.WatchService; 45 import static java.nio.file.StandardWatchEventKinds.ENTRY_CREATE; 46 import static java.nio.file.StandardWatchEventKinds.ENTRY_DELETE; [all …]
|
D | FilesSetup.java | 17 package libcore.java.nio.file; 29 import java.nio.file.CopyOption; 30 import java.nio.file.DirectoryStream; 31 import java.nio.file.Files; 32 import java.nio.file.LinkOption; 33 import java.nio.file.OpenOption; 34 import java.nio.file.Path; 35 import java.nio.file.Paths; 36 import java.nio.file.attribute.BasicFileAttributes; 147 static void writeToFile(Path file, String data, OpenOption... option) throws IOException { in writeToFile() argument [all …]
|
/libcore/luni/src/test/filesystems/src/mypackage/ |
D | MockFileSystemProvider.java | 22 import java.nio.file.AccessMode; 23 import java.nio.file.CopyOption; 24 import java.nio.file.DirectoryStream; 25 import java.nio.file.FileStore; 26 import java.nio.file.FileSystem; 27 import java.nio.file.LinkOption; 28 import java.nio.file.OpenOption; 29 import java.nio.file.Path; 30 import java.nio.file.attribute.BasicFileAttributes; 31 import java.nio.file.attribute.FileAttribute; [all …]
|
/libcore/ojluni/src/main/java/sun/net/www/protocol/jar/ |
D | Handler.java | 103 String file = u.getFile(); in hashCode() local 104 int sep = file.indexOf(separator); in hashCode() 107 return h + file.hashCode(); in hashCode() 110 String fileWithoutEntry = file.substring(0, sep); in hashCode() 118 String entry = file.substring(sep + 2); in hashCode() 129 String file = null; in parseURL() local 137 file = url.getFile(); in parseURL() 151 file = parseAbsoluteSpec(spec); in parseURL() 153 file = parseContextSpec(url, spec); in parseURL() 156 int bangSlash = indexOfBangSlash(file); in parseURL() [all …]
|
/libcore/ojluni/src/main/java/sun/net/www/protocol/file/ |
D | FileURLConnection.java | 32 package sun.net.www.protocol.file; 58 File file; field in FileURLConnection 67 protected FileURLConnection(URL u, File file) { in FileURLConnection() argument 69 this.file = file; in FileURLConnection() 81 filename = file.toString(); in connect() 82 isDirectory = file.isDirectory(); in connect() 84 String[] fileList = file.list(); in connect() 95 ProgressSource pi = new ProgressSource(url, "GET", file.length()); in connect() 96 is = new MeteredStream(is, pi, file.length()); in connect() 111 exists = file.exists(); in initializeHeaders() [all …]
|