Home
last modified time | relevance | path

Searched refs:file (Results 1 – 25 of 344) sorted by relevance

12345678910>>...14

/libcore/ojluni/src/test/java/nio/file/attribute/
DPosixFileAttributeViewTest.java32 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 …]
DBasicFileAttributeViewCreationTimeTest.java33 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 …]
DBasicFileAttributeViewTest.java32 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/
DFileTreeWalker.java26 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/java/nio/file/
DFileSystemException.java26 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()
DNotLinkException.java26 package java.nio.file;
46 public NotLinkException(String file) { in NotLinkException() argument
47 super(file); in NotLinkException()
60 public NotLinkException(String file, String other, String reason) { in NotLinkException() argument
61 super(file, other, reason); in NotLinkException()
DAccessDeniedException.java26 package java.nio.file;
51 public AccessDeniedException(String file) { in AccessDeniedException() argument
52 super(file); in AccessDeniedException()
65 public AccessDeniedException(String file, String other, String reason) { in AccessDeniedException() argument
66 super(file, other, reason); in AccessDeniedException()
DNoSuchFileException.java26 package java.nio.file;
46 public NoSuchFileException(String file) { in NoSuchFileException() argument
47 super(file); in NoSuchFileException()
60 public NoSuchFileException(String file, String other, String reason) { in NoSuchFileException() argument
61 super(file, other, reason); in NoSuchFileException()
DFileAlreadyExistsException.java26 package java.nio.file;
46 public FileAlreadyExistsException(String file) { in FileAlreadyExistsException() argument
47 super(file); in FileAlreadyExistsException()
60 public FileAlreadyExistsException(String file, String other, String reason) { in FileAlreadyExistsException() argument
61 super(file, other, reason); in FileAlreadyExistsException()
DFileTreeWalker.java26 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/sun/nio/fs/
DUnixException.java28 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 …]
DUnixSecureDirectoryStream.java28 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 …]
DUnixFileAttributeViews.java28 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 …]
DAbstractFileSystemProvider.java28 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 …]
DUnixFileSystemProvider.java28 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 …]
DLinuxUserDefinedFileAttributeView.java28 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 …]
DUnixFileStore.java28 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/luni/src/test/java/libcore/java/io/
DRandomAccessFileTest.java34 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 testSeekTooLarge()
55 try (RandomAccessFile raf = new RandomAccessFile(file, "rw")) { in testSetLengthTooLarge()
65 try (RandomAccessFile raf = new RandomAccessFile(file, "rw")) { in testSetLength64()
67 assertEquals(0, file.length()); in testSetLength64()
70 assertEquals(moreThanFourGig, file.length()); in testSetLength64()
76 File file = File.createTempFile("RandomAccessFileTest", "tmp"); in testRandomAccessFileHasCleanupFinalizer() local
77 try (RandomAccessFile accessFile = new RandomAccessFile(file, "rw")) { in testRandomAccessFileHasCleanupFinalizer()
[all …]
/libcore/ojluni/src/main/java/java/lang/
DProcessBuilder.java537 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/harmony-tests/src/test/java/org/apache/harmony/tests/java/io/
DOpenRandomFileTest.java37 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/ojluni/src/test/java/nio/file/
DTestUtil.java25 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/harmony-tests/src/test/java/org/apache/harmony/tests/java/util/jar/
DJarFileTest.java168 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/
DURL.java188 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/luni/src/test/filesystems/src/mypackage/
DMockFileSystemProvider.java22 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/luni/src/test/java/libcore/java/nio/file/attribute/
DAclEntryTest.java17 package libcore.java.nio.file.attribute;
23 import java.nio.file.attribute.AclEntry;
24 import java.nio.file.attribute.UserPrincipal;
25 import java.nio.file.attribute.AclEntryType;
26 import java.nio.file.attribute.AclEntryPermission;
27 import java.nio.file.attribute.AclEntryFlag;
28 import java.nio.file.Files;
29 import java.nio.file.Paths;

12345678910>>...14