org.refcodes.mixin.CreatedDateAccessor
, FileSizeAccessor
, org.refcodes.mixin.ModifiedDateAccessor
, org.refcodes.mixin.NameAccessor
, org.refcodes.mixin.PathAccessor
FileHandle.MutableFileHandle
FileHandleImpl
, FileHandleImpl.MutableFileHandleImpl
public interface FileHandle extends org.refcodes.mixin.PathAccessor, org.refcodes.mixin.NameAccessor, FileSizeAccessor, org.refcodes.mixin.CreatedDateAccessor, org.refcodes.mixin.ModifiedDateAccessor
Modifier and Type | Interface | Description |
---|---|---|
static interface |
FileHandle.MutableFileHandle |
The mutable
FileHandle allows the modification of (fiddling
around with) attributes.
-------------------------------------------------------------------------
ATTENTION: Usually fiddling around with attributes is not necessary, as
the FileSystem itself provides the sufficient functionality to
work with files. |
org.refcodes.mixin.CreatedDateAccessor.CreatedDateMutator, org.refcodes.mixin.CreatedDateAccessor.CreatedDateProperty
FileSizeAccessor.FileSizeMutator, FileSizeAccessor.FileSizeProperty
org.refcodes.mixin.ModifiedDateAccessor.ModifiedDateMutator, org.refcodes.mixin.ModifiedDateAccessor.ModifiedDateProperty
Modifier and Type | Method | Description |
---|---|---|
Date |
getCreatedDate() |
The date when the file was created.
|
long |
getFileSize() |
The size of the content of the file.
|
Date |
getModifiedDate() |
The date when the file was modified.
|
String |
getName() |
The name is the part of the key without the path.
|
String |
getPath() |
The path is the part of the key without the name.
|
String |
toKey() |
The key is the fully qualified name to identify the file.
|
FileHandle.MutableFileHandle |
toMutableFileHandle() |
Converts the give
FileHandle to a FileHandle.MutableFileHandle . |
String getPath()
FileSystem.PATH_DELIMITER
attribute.getPath
in interface org.refcodes.mixin.PathAccessor
String getName()
FileSystem.PATH_DELIMITER
attribute.getName
in interface org.refcodes.mixin.NameAccessor
String toKey()
long getFileSize()
getFileSize
in interface FileSizeAccessor
Date getCreatedDate()
getCreatedDate
in interface org.refcodes.mixin.CreatedDateAccessor
Date getModifiedDate()
getModifiedDate
in interface org.refcodes.mixin.ModifiedDateAccessor
FileHandle.MutableFileHandle toMutableFileHandle()
FileHandle
to a FileHandle.MutableFileHandle
. The
mutable FileHandle
allows the modification of (fiddling around
with) attributes.
-------------------------------------------------------------------------
ATTENTION: Usually fiddling around with attributes is not necessary, as
the FileSystem
itself provides the sufficient functionality to
work with files. In some cases though this might be necessary: This
method is being provided to allow modification of file attributes while
making sure that the FileHandle
itself creates a copy so that any
additional attributes provided by extensions of this interface of whom
the developer does not know (yet) are preserved. So extensions of the
FileHandle
know how to create a FileHandle.MutableFileHandle
without
information loss, the business logic does not require to take care of any
yet unknown extensions.
-------------------------------------------------------------------------
CAUTION: Working with modified FileHandle
s on the
FileSystem
can cause unexpected (severe) behavior (data loss), so
we assume that you know what you do when using the
FileHandle.MutableFileHandle
!
-------------------------------------------------------------------------
Use FileHandle.MutableFileHandle.toFileHandle()
to get back to a
FileHandle
to avoid hassle with collections, the
Object.hashCode()
and the Object.equals(Object)
operations.Copyright © 2021. All rights reserved.