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 classAFile.Defaultstatic interfaceAFile.Observerstatic interfaceAFile.WrapperNested classes/interfaces inherited from interface one.microstream.afs.types.AItem
AItem.Abstract, AItem.Base -
Method Summary
Modifier and Type Method Description static AFileactual(AFile file)default ObjectdefaultUser()default booleanensureExists()default booleanexists()Queries whether the item represented by this instance actually physically exists on the underlying storage layer.default booleanisEmpty()default booleanisUsed()<C extends Consumer<? super AFile.Observer>>
CiterateObservers(C logic)default Stringname()A simple String representing the "name" of the file.static AFileNew(ADirectory parent, String identifier)booleanregisterObserver(AFile.Observer observer)booleanremoveObserver(AFile.Observer observer)default longsize()Returns the size in bytes of this file's content, without any space required for file metadata (name etc.).default String[]toPath()default StringtoPathString()The value that uniquely identifies the item globally in the whole file system.default AReadableFiletryUseReading()default AReadableFiletryUseReading(Object user)default AWritableFiletryUseWriting()default AWritableFiletryUseWriting(Object user)default Stringtype()An optional String defining the type of the file's content.default AReadableFileuseReading()default AReadableFileuseReading(Object user)default AWritableFileuseWriting()default AWritableFileuseWriting(Object user)
-
Method Details
-
toPathString
Description copied from interface:AItemThe 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:
toPathStringin 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:AItemQueries 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
-