public final class TruffleFile extends Object
| Modifier and Type | Class and Description |
|---|---|
static class |
TruffleFile.AttributeDescriptor<T>
Represents a file's attribute.
|
static class |
TruffleFile.Attributes
A view over file's attributes values obtained by
getAttributes. |
static interface |
TruffleFile.FileTypeDetector
A detector for finding
file's MIME type and encoding. |
| Modifier and Type | Method and Description |
|---|---|
void |
copy(TruffleFile target,
CopyOption... options)
Copies the file.
|
void |
createDirectories(FileAttribute<?>... attributes)
Creates a directory and all nonexistent parent directories.
|
void |
createDirectory(FileAttribute<?>... attributes)
Creates a new directory.
|
void |
createFile(FileAttribute<?>... attributes)
Creates a new empty file.
|
void |
createLink(TruffleFile target)
Creates a new link to an existing target (optional operation).
|
void |
createSymbolicLink(TruffleFile target,
FileAttribute<?>... attrs)
Creates a symbolic link to a target (optional operation).
|
void |
delete()
Deletes the file.
|
String |
detectMimeType()
Detects the
file MIME type. |
boolean |
endsWith(String other)
Tests if this
TruffleFile path ends with the given path. |
boolean |
endsWith(TruffleFile other)
Tests if this
TruffleFile path ends with the given TruffleFile path. |
boolean |
equals(Object other) |
boolean |
exists(LinkOption... options)
Tests existence of a file.
|
TruffleFile |
getAbsoluteFile()
Resolves this
TruffleFile to absolute TruffleFile. |
<T> T |
getAttribute(TruffleFile.AttributeDescriptor<T> attribute,
LinkOption... linkOptions)
Reads a single file's attribute.
|
TruffleFile.Attributes |
getAttributes(Collection<? extends TruffleFile.AttributeDescriptor<?>> attributes,
LinkOption... linkOptions)
Reads file's attributes as a bulk operation.
|
TruffleFile |
getCanonicalFile(LinkOption... options)
Returns a
TruffleFile representing the real (canonical) path of an existing file. |
FileTime |
getCreationTime(LinkOption... options)
Returns the creation time.
|
GroupPrincipal |
getGroup(LinkOption... options)
Returns the group owner of the file.
|
FileTime |
getLastAccessTime(LinkOption... options)
Returns the last access time.
|
FileTime |
getLastModifiedTime(LinkOption... options)
Returns the last modified time.
|
String |
getName()
Returns the name of this
TruffleFile. |
UserPrincipal |
getOwner(LinkOption... options)
Returns the owner of the file.
|
TruffleFile |
getParent()
Returns a parent
TruffleFile or null when the file does not have a parent. |
String |
getPath()
Returns the string representation of this
TruffleFile. |
Set<PosixFilePermission> |
getPosixPermissions(LinkOption... linkOptions)
Returns the file's Posix permissions.
|
int |
hashCode() |
boolean |
isAbsolute()
Tests if this
TruffleFile's path is absolute. |
boolean |
isDirectory(LinkOption... options)
Tests if a file is a directory.
|
boolean |
isExecutable()
Tests if a file is executable.
|
boolean |
isReadable()
Tests if a file is readable.
|
boolean |
isRegularFile(LinkOption... options)
Tests if a file is a regular file.
|
boolean |
isSameFile(TruffleFile other,
LinkOption... options)
Tests if this and the given
TruffleFile refer to the same physical file. |
boolean |
isSymbolicLink()
Tests if a file is a symbolic link.
|
boolean |
isWritable()
Tests if a file is writable.
|
Collection<TruffleFile> |
list()
Returns a collection of
TruffleFiles in the directory denoted by this
TruffleFile. |
void |
move(TruffleFile target,
CopyOption... options)
Moves or renames the file.
|
BufferedReader |
newBufferedReader()
Opens a file for reading returning a
BufferedReader to access the file content. |
BufferedReader |
newBufferedReader(Charset charset)
Opens a file for reading returning a
BufferedReader to access the file content. |
BufferedWriter |
newBufferedWriter(Charset charset,
OpenOption... options)
Opens a file for writing returning an
BufferedWriter. |
BufferedWriter |
newBufferedWriter(OpenOption... options)
Opens a file for writing returning an
BufferedWriter. |
SeekableByteChannel |
newByteChannel(Set<? extends OpenOption> options,
FileAttribute<?>... attributes)
Opens or creates a file returning a
SeekableByteChannel to access the file content. |
DirectoryStream<TruffleFile> |
newDirectoryStream()
Opens a directory, returning a
DirectoryStream to iterate over all entries in the
directory. |
InputStream |
newInputStream(OpenOption... options)
Opens a file for reading returning an
InputStream to access the file content. |
OutputStream |
newOutputStream(OpenOption... options)
Opens a file for writing returning an
OutputStream. |
TruffleFile |
normalize()
Returns a
TruffleFile with removed redundant name elements in it's path. |
byte[] |
readAllBytes()
Reads a file content as bytes.
|
TruffleFile |
readSymbolicLink()
Reads the target of a symbolic link.
|
TruffleFile |
relativize(TruffleFile other)
|
TruffleFile |
resolve(String name)
Resolves given string path representation against this
TruffleFile. |
TruffleFile |
resolveSibling(String name)
Resolves given string path representation against the parent of this
TruffleFile. |
<T> void |
setAttribute(TruffleFile.AttributeDescriptor<T> attribute,
T value,
LinkOption... linkOptions)
Sets a single file's attribute.
|
void |
setCreationTime(FileTime time,
LinkOption... options)
Sets the file's creation time.
|
void |
setLastAccessTime(FileTime time,
LinkOption... options)
Sets the file's last access time.
|
void |
setLastModifiedTime(FileTime time,
LinkOption... options)
Sets the file's last modified time.
|
void |
setPosixPermissions(Set<? extends PosixFilePermission> permissions,
LinkOption... linkOptions)
Sets the file's Posix permissions.
|
long |
size(LinkOption... options)
Returns the size of a file.
|
boolean |
startsWith(String other)
Tests if this
TruffleFile path starts with the given path. |
boolean |
startsWith(TruffleFile other)
Tests if this
TruffleFile path starts with the given TruffleFile path. |
URI |
toRelativeUri()
Returns a relative
URI representation of non absolute TruffleFile. |
String |
toString() |
URI |
toUri()
Returns the absolute
URI representation of this TruffleFile. |
void |
visit(FileVisitor<TruffleFile> visitor,
int maxDepth,
FileVisitOption... options)
Visits this
TruffleFile file tree. |
public static final TruffleFile.AttributeDescriptor<FileTime> LAST_MODIFIED_TIME
public static final TruffleFile.AttributeDescriptor<FileTime> LAST_ACCESS_TIME
public static final TruffleFile.AttributeDescriptor<FileTime> CREATION_TIME
public static final TruffleFile.AttributeDescriptor<Boolean> IS_REGULAR_FILE
public static final TruffleFile.AttributeDescriptor<Boolean> IS_DIRECTORY
public static final TruffleFile.AttributeDescriptor<Boolean> IS_SYMBOLIC_LINK
public static final TruffleFile.AttributeDescriptor<Boolean> IS_OTHER
public static final TruffleFile.AttributeDescriptor<Long> SIZE
public static final TruffleFile.AttributeDescriptor<UserPrincipal> UNIX_OWNER
public static final TruffleFile.AttributeDescriptor<GroupPrincipal> UNIX_GROUP
public static final TruffleFile.AttributeDescriptor<Set<PosixFilePermission>> UNIX_PERMISSIONS
public static final TruffleFile.AttributeDescriptor<Integer> UNIX_MODE
public static final TruffleFile.AttributeDescriptor<Long> UNIX_INODE
public static final TruffleFile.AttributeDescriptor<Long> UNIX_DEV
public static final TruffleFile.AttributeDescriptor<Long> UNIX_RDEV
public static final TruffleFile.AttributeDescriptor<Integer> UNIX_NLINK
public static final TruffleFile.AttributeDescriptor<Integer> UNIX_UID
public static final TruffleFile.AttributeDescriptor<Integer> UNIX_GID
public static final TruffleFile.AttributeDescriptor<FileTime> UNIX_CTIME
public boolean exists(LinkOption... options)
options - the options determining how the symbolic links should be handledtrue if the file existsSecurityException - if the FileSystem denied the operationpublic boolean isReadable()
true if the file exists and is readableSecurityException - if the FileSystem denied the operationpublic boolean isWritable()
true if the file exists and is writableSecurityException - if the FileSystem denied the operationpublic boolean isExecutable()
true if the file exists and is executableSecurityException - if the FileSystem denied the operationpublic boolean isDirectory(LinkOption... options)
options - the options determining how the symbolic links should be handled, by default
the symbolic links are followed.true if the file exists and is a directorySecurityException - if the FileSystem denied the operationpublic boolean isRegularFile(LinkOption... options)
options - the options determining how the symbolic links should be handled, by default
the symbolic links are followed.true if the file exists and is a regular fileSecurityException - if the FileSystem denied the operationpublic boolean isSymbolicLink()
true if the file exists and is a symbolic linkSecurityException - if the FileSystem denied the operationpublic boolean isAbsolute()
TruffleFile's path is absolute.true if the file path is absolutepublic String getName()
TruffleFile.TruffleFile, or null if
the file is a root directorypublic String getPath()
TruffleFile.TruffleFilepublic URI toUri()
URI representation of this TruffleFile.URI representing the TruffleFileSecurityException - if the FileSystem denied a resolution of an absolute pathpublic URI toRelativeUri()
URI representation of non absolute TruffleFile. If this
TruffleFile is relative it returns a relative URI. For an
absolute TruffleFile it returns an absolute URI.URI representing the TruffleFilepublic TruffleFile getAbsoluteFile()
TruffleFile to absolute TruffleFile. If this
TruffleFile is already absolute this method returns this TruffleFile without
any resolution.TruffleFileSecurityException - if the FileSystem denied a resolution of an absolute pathpublic TruffleFile getCanonicalFile(LinkOption... options) throws IOException
TruffleFile representing the real (canonical) path of an existing file.options - the options determining how the symbolic links should be handledTruffleFile representing the absolute canonical pathIOException - in case of IO errorSecurityException - if the FileSystem denied the operationpublic TruffleFile getParent()
TruffleFile or null when the file does not have a parent.TruffleFilepublic TruffleFile resolve(String name)
TruffleFile.name - the path to resolveTruffleFileInvalidPathException - if the path string contains non valid characterspublic TruffleFile resolveSibling(String name)
TruffleFile.name - the path to resolveTruffleFileInvalidPathException - if the path string contains non valid characterspublic long size(LinkOption... options) throws IOException
options - the options determining how the symbolic links should be handledIOException - in case of IO errorSecurityException - if the FileSystem denied the operationpublic FileTime getLastModifiedTime(LinkOption... options) throws IOException
options - the options determining how the symbolic links should be handledFileTime representing the time this TruffleFile was last modifiedIOException - in case of IO errorSecurityException - if the FileSystem denied the operationpublic void setLastModifiedTime(FileTime time, LinkOption... options) throws IOException
time - the new value of the last modified timeoptions - the options determining how the symbolic links should be handledIOException - in case of IO errorSecurityException - if the FileSystem denied the operationpublic FileTime getLastAccessTime(LinkOption... options) throws IOException
options - the options determining how the symbolic links should be handledFileTime representing the time this TruffleFile was last accessedIOException - in case of IO errorSecurityException - if the FileSystem denied the operationpublic void setLastAccessTime(FileTime time, LinkOption... options) throws IOException
time - the new value of the last access timeoptions - the options determining how the symbolic links should be handledIOException - in case of IO errorSecurityException - if the FileSystem denied the operationpublic FileTime getCreationTime(LinkOption... options) throws IOException
options - the options determining how the symbolic links should be handledFileTime representing the time this TruffleFile was createdIOException - in case of IO errorSecurityException - if the FileSystem denied the operationpublic void setCreationTime(FileTime time, LinkOption... options) throws IOException
time - the new value of the creation timeoptions - the options determining how the symbolic links should be handledIOException - in case of IO errorSecurityException - if the FileSystem denied the operationpublic Collection<TruffleFile> list() throws IOException
TruffleFiles in the directory denoted by this
TruffleFile.TruffleFiles located in the directory denoted by this
TruffleFileIOException - in case of IO errorSecurityException - if the FileSystem denied the operationpublic SeekableByteChannel newByteChannel(Set<? extends OpenOption> options, FileAttribute<?>... attributes) throws IOException
SeekableByteChannel to access the file content.
In most cases, the returned SeekableByteChannel should be closed using
try-with-resources construct. When the channel must keep being opened for the lifetime of a
context it should be registered for automatic close
on context dispose.options - the options specifying how the file should be openedattributes - the optional attributes to set atomically when creating the new fileSeekableByteChannelFileAlreadyExistsException - if StandardOpenOption.CREATE_NEW option is set and
a file already exists on given pathIOException - in case of IO errorUnsupportedOperationException - if the attributes contain an attribute which cannot be
set atomicallyIllegalArgumentException - in case of invalid options combinationSecurityException - if the FileSystem denied the operationpublic InputStream newInputStream(OpenOption... options) throws IOException
InputStream to access the file content. In most
cases, the returned InputStream should be closed using try-with-resources construct.
When the stream must keep being opened for the lifetime of a context it should be
registered for automatic close on context dispose.options - the options specifying how the file should be openedInputStreamIOException - in case of IO errorIllegalArgumentException - in case of invalid options combinationSecurityException - if the FileSystem denied the operationpublic BufferedReader newBufferedReader(Charset charset) throws IOException
BufferedReader to access the file content. In
most cases, the returned BufferedReader should be closed using try-with-resources
construct. When the reader must keep being opened for the lifetime of a context it should be
registered for automatic close on context dispose.charset - the file encodingBufferedReaderIOException - in case of IO errorSecurityException - if the FileSystem denied the operationpublic BufferedReader newBufferedReader() throws IOException
BufferedReader to access the file content. See
TruffleFile.newBufferedReader(Charset).BufferedReaderIOException - in case of IO errorSecurityException - if the FileSystem denied the operationpublic byte[] readAllBytes()
throws IOException
byte[]IOException - in case of IO errorOutOfMemoryError - if an array of a file size cannot be allocatedSecurityException - if the FileSystem denied the operationpublic OutputStream newOutputStream(OpenOption... options) throws IOException
OutputStream. In most cases, the returned
OutputStream should be closed using try-with-resources construct. When the stream
must keep being opened for the lifetime of a context it should be
registered for automatic close on context dispose.options - the options specifying how the file should be openedOutputStreamIOException - in case of IO errorIllegalArgumentException - in case of invalid options combinationSecurityException - if the FileSystem denied the operationpublic BufferedWriter newBufferedWriter(Charset charset, OpenOption... options) throws IOException
BufferedWriter. In most cases, the returned
BufferedWriter should be closed using try-with-resources construct. When the writer
must keep being opened for the lifetime of a context it should be
registered for automatic close on context dispose.charset - the file encodingoptions - the options specifying how the file should be openedBufferedWriterIOException - in case of IO errorIllegalArgumentException - in case of invalid options combinationSecurityException - if the FileSystem denied the operationpublic BufferedWriter newBufferedWriter(OpenOption... options) throws IOException
BufferedWriter. See
TruffleFile.newBufferedWriter(Charset, OpenOption...).options - the options specifying how the file should be openedBufferedWriterIOException - in case of IO errorIllegalArgumentException - in case of invalid options combinationSecurityException - if the FileSystem denied the operationpublic void createFile(FileAttribute<?>... attributes) throws IOException
attributes - the optional attributes to set atomically when creating the new fileFileAlreadyExistsException - if the file already exists on given pathIOException - in case of IO errorUnsupportedOperationException - if the attributes contain an attribute which cannot be
set atomicallySecurityException - if the FileSystem denied the operationpublic void createDirectory(FileAttribute<?>... attributes) throws IOException
attributes - the optional attributes to set atomically when creating the new fileFileAlreadyExistsException - if the file or directory already exists on given pathIOException - in case of IO errorUnsupportedOperationException - if the attributes contain an attribute which cannot be
set atomicallySecurityException - if the FileSystem denied the operationpublic void createDirectories(FileAttribute<?>... attributes) throws IOException
TruffleFile.createDirectory(java.nio.file.attribute.FileAttribute<?>...) the FileAlreadyExistsException is not thrown if the
directory already exists.attributes - the optional attributes to set atomically when creating the new fileFileAlreadyExistsException - if a file (not a directory) already exists on given pathIOException - in case of IO errorUnsupportedOperationException - if the attributes contain an attribute which cannot be
set atomicallySecurityException - if the FileSystem denied the operationpublic void delete()
throws IOException
TruffleFile denotes a directory, the directory must be empty
before deleting. If the TruffleFile denotes a symbolic link the symbolic link itself
is deleted not its target.NoSuchFileException - if the file does not existDirectoryNotEmptyException - if the TruffleFile denotes a non empty directoryIOException - in case of IO errorSecurityException - if the FileSystem denied the operationpublic void move(TruffleFile target, CopyOption... options) throws IOException
target - the path of a target fileoptions - the options specifying how the move should be performed, see
StandardCopyOptionUnsupportedOperationException - if options contains unsupported optionFileAlreadyExistsException - if the target path already exists and the options
don't contain StandardCopyOption.REPLACE_EXISTING optionDirectoryNotEmptyException - if the options contain
StandardCopyOption.REPLACE_EXISTING but the target is a non empty
directoryAtomicMoveNotSupportedException - if the options contain
StandardCopyOption.ATOMIC_MOVE but file cannot be moved atomicallyIOException - in case of IO errorSecurityException - if the FileSystem denied the operationpublic Set<PosixFilePermission> getPosixPermissions(LinkOption... linkOptions) throws IOException
linkOptions - the options determining how the symbolic links should be handledIOException - in case of IO errorUnsupportedOperationException - when the Posix permissions are not supported by
filesystemSecurityException - if the FileSystem denied the operationpublic void setPosixPermissions(Set<? extends PosixFilePermission> permissions, LinkOption... linkOptions) throws IOException
permissions - the Posix permissions to setlinkOptions - the options determining how the symbolic links should be handledIOException - in case of IO errorUnsupportedOperationException - when the Posix permissions are not supported by
filesystemSecurityException - if the FileSystem denied the operationpublic TruffleFile normalize()
TruffleFile with removed redundant name elements in it's path.TruffleFilepublic TruffleFile relativize(TruffleFile other)
TruffleFile with a relative path between this TruffleFile and a
given TruffleFile.
Relativization is the inverse of resolution.
Relativization constructs a TruffleFile with relative path that when
resolved against this TruffleFile yields a
TruffleFile locating the same file as given TruffleFile. A relative path
cannot be constructed if only one of the TruffleFiles is absolute.
other - the TruffleFile to relativize against this TruffleFileTruffleFile with relative path between this and other
TruffleFilesIllegalArgumentException - when other cannot be relativized against this
TruffleFilepublic boolean startsWith(String other)
TruffleFile path starts with the given path. The path foo/bar
starts with foo and foo/bar but does not start with f.other - the pathtrue if this TruffleFile path starts with given pathIllegalArgumentException - if the path cannot be parsed.public boolean startsWith(TruffleFile other)
TruffleFile path starts with the given TruffleFile path. The
path foo/bar starts with foo and foo/bar but does not start with
f.other - the TruffleFiletrue if this TruffleFile path starts with given TruffleFile
pathpublic boolean endsWith(String other)
TruffleFile path ends with the given path. The path foo/bar
ends with bar and foo/bar but does not end with r.other - the pathtrue if this TruffleFile path ends with given pathIllegalArgumentException - if the path cannot be parsed.public boolean endsWith(TruffleFile other)
TruffleFile path ends with the given TruffleFile path. The path
foo/bar ends with bar and foo/bar but does not end with r.other - the TruffleFiletrue if this TruffleFile path ends with given TruffleFile
pathpublic void createLink(TruffleFile target) throws IOException
target - the existing file to linkFileAlreadyExistsException - if the file or directory already exists on given pathIOException - in case of IO errorUnsupportedOperationException - if the FileSystem implementation does not
support linksSecurityException - if the FileSystem denied the operationpublic void createSymbolicLink(TruffleFile target, FileAttribute<?>... attrs) throws IOException
target - the target of the symbolic linkattrs - the optional attributes to set atomically when creating the symbolic linkFileAlreadyExistsException - if the file or directory already exists on given pathIOException - in case of IO errorUnsupportedOperationException - if the FileSystem implementation does not
support symbolic links or the attributes contain an attribute which cannot be set
atomicallySecurityException - if the FileSystem denied the operationpublic TruffleFile readSymbolicLink() throws IOException
TruffleFile representing the target of the symbolic linkNotLinkException - if the TruffleFile is not a symbolic linkIOException - in case of IO errorUnsupportedOperationException - if the FileSystem implementation does not
support symbolic linksSecurityException - if the FileSystem denied the operationpublic UserPrincipal getOwner(LinkOption... options) throws IOException
options - the options determining how the symbolic links should be handledIOException - in case of IO errorUnsupportedOperationException - if the FileSystem implementation does not
support owner attributeSecurityException - if the FileSystem denied the operationpublic GroupPrincipal getGroup(LinkOption... options) throws IOException
options - the options determining how the symbolic links should be handledIOException - in case of IO errorUnsupportedOperationException - if the FileSystem implementation does not
support group owner attributeSecurityException - if the FileSystem denied the operationpublic DirectoryStream<TruffleFile> newDirectoryStream() throws IOException
DirectoryStream to iterate over all entries in the
directory.
The TruffleFiles returned by the directory stream's iterator are created as if by resolving the name of the
directory entry against this TruffleFile.
In most cases, the returned DirectoryStream should be closed using try-with-resources
construct. When the stream must keep being opened for the lifetime of a context it should be
registered for automatic close on context dispose.
When not using the try-with-resources construct, then the directory stream's
close method should be called after iteration is completed.
The code which iterates over all files can use simpler TruffleFile.list() method.
DirectoryStream objectIOException - in case of IO errorSecurityException - if the FileSystem denied the operationpublic void visit(FileVisitor<TruffleFile> visitor, int maxDepth, FileVisitOption... options) throws IOException
TruffleFile file tree.
This method walks a file tree rooted at this TruffleFile. The file tree traversal is
depth-first. The appropriate method on give FileVisitor is invoked for each
met file. File tree traversal completes when all accessible files in the tree have been
visited, a FileVisitor visit method returns a FileVisitResult.TERMINATE or a
FileVisitor method terminates due to an uncaught exception.
For each file encountered this method attempts to read its
BasicFileAttributes. If the file is not a directory then the
visitFile method is invoked with the file attributes. If the
file attributes cannot be read, due to an I/O exception, then the
visitFileFailed method is invoked with the I/O exception.
Where the file is a directory, and the directory could not be opened, then the
visitFileFailed method is invoked with the I/O exception, after which, the file tree
walk continues, by default, at the next sibling of the directory.
Where the directory is opened successfully, then the entries in the directory, and their
descendants are visited. When all entries have been visited, or an I/O error occurs
during iteration of the directory, then the directory is closed and the visitor's
postVisitDirectory method is invoked. The file tree
walk then continues, by default, at the next sibling of the directory.
By default, symbolic links are not automatically followed by this method. If the
options parameter contains the FOLLOW_LINKS
option then symbolic links are followed.
The maxDepth parameter is the maximum number of levels of directories to visit. A
value of 0 means that only the starting file is visited. The visitFile method
is invoked for all files, including directories, encountered at maxDepth, unless the
basic file attributes cannot be read, in which case the visitFileFailed method is invoked.
visitor - the FileVisitor to invoke for each filemaxDepth - the maximum number of directory levels to visit, MAX_VALUE may be used to indicate that all levels should be visited.options - the options configuring the file tree traversalIllegalArgumentException - if the maxDepth parameter is negativeIOException - in case of IO errorSecurityException - if the FileSystem denied the operationpublic void copy(TruffleFile target, CopyOption... options) throws IOException
visit method to copy the whole sub-tree.target - the path of a target fileoptions - the options specifying how the copy should be performed, see
StandardCopyOptionUnsupportedOperationException - if options contains unsupported optionFileAlreadyExistsException - if the target path already exists and the options
don't contain StandardCopyOption.REPLACE_EXISTING optionDirectoryNotEmptyException - if the options contain
StandardCopyOption.REPLACE_EXISTING but the target is a non empty
directoryIOException - in case of IO errorSecurityException - if the FileSystem denied the operationpublic String detectMimeType()
file MIME type.null if the MIME type is not recognizedSecurityException - if the FileSystem denied the operationpublic boolean isSameFile(TruffleFile other, LinkOption... options) throws IOException
TruffleFile refer to the same physical file. If both
TruffleFile objects are equal then this method
returns true without any checks. If the TruffleFiles have different
filesystems then this method returns false. Otherwise, this method checks if both
TruffleFiles refer to the same physical file. Depending on the FileSystem
implementation it may require to read the files attributes. This implies:
other - the other TruffleFiletrue if this and the given TruffleFile refer to the same physical
fileIOException - in case of IO errorSecurityException - if the FileSystem denied the operationpublic <T> T getAttribute(TruffleFile.AttributeDescriptor<T> attribute, LinkOption... linkOptions) throws IOException
attribute - the attribute to readlinkOptions - the options determining how the symbolic links should be handledIOException - in case of IO errorUnsupportedOperationException - when the filesystem does not support required
attribute.SecurityException - if the FileSystem denied the operationpublic <T> void setAttribute(TruffleFile.AttributeDescriptor<T> attribute, T value, LinkOption... linkOptions) throws IOException
attribute - the attribute to setvalue - the attribute valuelinkOptions - the options determining how the symbolic links should be handledIOException - in case of IO errorUnsupportedOperationException - when the filesystem does not support given attributeIllegalArgumentException - when the attribute value has an inappropriate valueSecurityException - if the FileSystem denied the operationpublic TruffleFile.Attributes getAttributes(Collection<? extends TruffleFile.AttributeDescriptor<?>> attributes, LinkOption... linkOptions) throws IOException
attributes - the attributes to readlinkOptions - the options determining how the symbolic links should be handledattributes viewIllegalArgumentException - when no attributes are givenIOException - in case of IO errorUnsupportedOperationException - when the filesystem does not support some of the
required attributes.SecurityException - if the FileSystem denied the operation