Package org.eclipse.serializer.afs.types
Interface AFile
-
- All Superinterfaces:
AItem
- All Known Subinterfaces:
AFile.Wrapper,AReadableFile,AWritableFile
- All Known Implementing Classes:
AFile.Default,AFile.Wrapper.Abstract
public interface AFile extends AItem
-
-
Nested Class Summary
Nested Classes Modifier and Type Interface Description static classAFile.Defaultstatic interfaceAFile.Observerstatic interfaceAFile.Wrapper-
Nested classes/interfaces inherited from interface org.eclipse.serializer.afs.types.AItem
AItem.Abstract, AItem.Base
-
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Default Methods 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)-
Methods inherited from interface org.eclipse.serializer.afs.types.AItem
fileSystem, identifier, parent
-
-
-
-
Method Detail
-
toPathString
default String 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()
-
name
default String 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
default String 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
boolean registerObserver(AFile.Observer observer)
-
removeObserver
boolean removeObserver(AFile.Observer observer)
-
iterateObservers
<C extends Consumer<? super AFile.Observer>> C iterateObservers(C logic)
-
useReading
default AReadableFile useReading(Object user)
-
useWriting
default AWritableFile useWriting(Object user)
-
useReading
default AReadableFile useReading()
-
useWriting
default AWritableFile useWriting()
-
tryUseReading
default AReadableFile tryUseReading(Object user)
-
tryUseWriting
default AWritableFile tryUseWriting(Object user)
-
tryUseReading
default AReadableFile tryUseReading()
-
tryUseWriting
default AWritableFile 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
default Object defaultUser()
-
New
static AFile New(ADirectory parent, String identifier)
-
-