Package one.microstream.afs.types
Interface AFile
- All Superinterfaces:
AItem
- All Known Subinterfaces:
AFile.Wrapper
,AReadableFile
,AWritableFile
,NioFileWrapper
,NioReadableFile
,NioWritableFile
,SqlFileWrapper
,SqlReadableFile
,SqlWritableFile
- All Known Implementing Classes:
AFile.Default
,AFile.Wrapper.Abstract
,NioFileWrapper.Abstract
,NioReadableFile.Default
,NioWritableFile.Default
,SqlFileWrapper.Abstract
,SqlReadableFile.Default
,SqlWritableFile.Default
public interface AFile extends AItem
-
Nested Class Summary
Nested Classes Modifier and Type Interface Description static class
AFile.Default
static interface
AFile.Observer
static interface
AFile.Wrapper
Nested classes/interfaces inherited from interface one.microstream.afs.types.AItem
AItem.Abstract, AItem.Base
-
Method Summary
Modifier and Type Method Description static AFile
actual(AFile file)
default Object
defaultUser()
default boolean
ensureExists()
default boolean
exists()
Queries whether the item represented by this instance actually physically exists on the underlying storage layer.default boolean
isEmpty()
default boolean
isUsed()
<C extends Consumer<? super AFile.Observer>>
CiterateObservers(C logic)
default String
name()
A simple String representing the "name" of the file.static AFile
New(ADirectory parent, String identifier)
boolean
registerObserver(AFile.Observer observer)
boolean
removeObserver(AFile.Observer observer)
default long
size()
Returns the size in bytes of this file's content, without any space required for file metadata (name etc.).default String[]
toPath()
default String
toPathString()
The value that uniquely identifies the item globally in the whole file system.default AReadableFile
tryUseReading()
default AReadableFile
tryUseReading(Object user)
default AWritableFile
tryUseWriting()
default AWritableFile
tryUseWriting(Object user)
default String
type()
An optional String defining the type of the file's content.default AReadableFile
useReading()
default AReadableFile
useReading(Object user)
default AWritableFile
useWriting()
default AWritableFile
useWriting(Object user)
-
Method Details
-
toPathString
Description copied from interface:AItem
The value that uniquely identifies the item globally in the whole file system.Note that this value is usually a combination of the identifiers of
AItem.parent()
directories and the localAItem.identifier()
, but such a relation is not mandatory.- Specified by:
toPathString
in interfaceAItem
- Returns:
- the item's globally unique identifier.
- See Also:
AItem.parent()
,AItem.identifier()
-
toPath
-
name
A simple String representing the "name" of the file. While no two files can have the sameAItem.identifier()
inside a given directory, any number of files can have the same name.Depending on the file system implementation,
name()
might be the same value asAItem.identifier()
, but whileAItem.identifier()
is guaranteed to be a unique local identifier for any file system,name()
is not.- Returns:
- the file's name.
- See Also:
toPathString()
,AItem.identifier()
,type()
-
type
An optional String defining the type of the file's content.If such an information makes no sense for a certain file system, this value may be
null
.- Returns:
- the file's type.
-
size
default long size()Returns the size in bytes of this file's content, without any space required for file metadata (name etc.).- Returns:
- the size in bytes of this file's content.
-
isEmpty
default boolean isEmpty() -
registerObserver
-
removeObserver
-
iterateObservers
-
useReading
-
useWriting
-
useReading
-
useWriting
-
tryUseReading
-
tryUseWriting
-
tryUseReading
-
tryUseWriting
-
exists
default boolean exists()Description copied from interface:AItem
Queries whether the item represented by this instance actually physically exists on the underlying storage layer. -
ensureExists
default boolean ensureExists() -
isUsed
default boolean isUsed() -
defaultUser
-
New
-
actual
-