This class and its children serve to unify handling of files and directories. These files and directories may or may not have some real counter part within the file system. For example, some file handles reference files within a zip archive or virtual ones that exist only in memory.
Every abstract file has a path (i.e. a full name) and a name (i.e. a short name) and may be backed by some real File. There are two different kinds of abstract files: regular files and directories. Regular files may be read and have a last modification time. Directories may list their content and look for subfiles with a specified name or path and of a specified kind.
The interface does not allow to access the content.
The class symtab.classfile.AbstractFileReader
accesses
bytes, knowing that the character set of classfiles is UTF-8. For
all other cases, the class SourceFile
is used, which honors
global.settings.encoding.value
.
''Note: This library is considered experimental and should not be used unless you know what you are doing.''
- Companion
- object
Value members
Abstract methods
Returns the containing directory of this abstract file
Returns the containing directory of this abstract file
Create a file on disk, if one does not exist already.
Create a file on disk, if one does not exist already.
Delete the underlying file or directory (recursively).
Delete the underlying file or directory (recursively).
Returns all abstract subfiles of this abstract directory.
Returns all abstract subfiles of this abstract directory.
Returns the underlying Path if any and null otherwise.
Returns the underlying Path if any and null otherwise.
Returns the time that this abstract file was last modified.
Returns the time that this abstract file was last modified.
Returns the abstract file in this abstract directory with the specified
name. If there is no such file, returns null
. The argument
directory
tells whether to look for a directory or
a regular file.
Returns the abstract file in this abstract directory with the specified
name. If there is no such file, returns null
. The argument
directory
tells whether to look for a directory or
a regular file.
Returns an abstract file with the given name. It does not check that it exists.
Returns an abstract file with the given name. It does not check that it exists.
Concrete methods
Returns a buffered output stream for writing the file - defaults to out
Returns a buffered output stream for writing the file - defaults to out
Returns the path of this abstract file in a canonical form.
Returns the path of this abstract file in a canonical form.
Returns the underlying File if any and null otherwise.
Returns the underlying File if any and null otherwise.
Get the file in this directory with the given name, creating an empty file if it does not already existing.
Get the file in this directory with the given name, creating an empty file if it does not already existing.
Does this abstract file represent something which can contain classfiles?
Does this abstract file represent something which can contain classfiles?
Does this abstract file correspond to something on-disk?
Does this abstract file correspond to something on-disk?
Drill down through subdirs looking for the target, as in lookupName. Ths target name is the last of parts.
Drill down through subdirs looking for the target, as in lookupName. Ths target name is the last of parts.
Return an abstract file that does not check that path
denotes
an existing file.
Return an abstract file that does not check that path
denotes
an existing file.
Get the subdirectory with a given name, creating it if it does not already exist.
Get the subdirectory with a given name, creating it if it does not already exist.
Returns contents of file (if applicable) in a byte array.
Returns contents of file (if applicable) in a byte array.
Returns contents of file (if applicable) in a Char array.
warning: use Global.getSourceFile()
to use the proper
encoding when converting to the char array.
Returns contents of file (if applicable) in a Char array.
warning: use Global.getSourceFile()
to use the proper
encoding when converting to the char array.
Returns the path of this abstract file.
Returns the path of this abstract file.
- Definition Classes
- Iterable -> Any
Inherited methods
- Inherited from
- IterableOps
- Inherited from
- IterableOnceOps
- Inherited from
- IterableOnceOps
- Inherited from
- IterableOnceOps
- Inherited from
- IterableOps
- Inherited from
- IterableOnceOps
- Inherited from
- IterableOps
Deprecated and Inherited methods
- Deprecated
- Inherited from
- IterableOps
- Deprecated
- Inherited from
- IterableOnceOps
- Deprecated
- Inherited from
- IterableOnceOps
- Deprecated
- Inherited from
- IterableOps
- Deprecated
- Inherited from
- IterableOnceOps
- Deprecated
- Inherited from
- IterableOnceOps
- Deprecated
- Inherited from
- IterableOps
- Deprecated
- Inherited from
- Iterable
- Deprecated
- Inherited from
- IterableOnceOps
- Deprecated
- Inherited from
- IterableOnceOps
- Deprecated
- Inherited from
- IterableOps