Class DiskFileStoreAdapter.DiskFileEntryAdapter
java.lang.Object
com.webcodepro.applecommander.storage.DiskFileStoreAdapter.DiskFileEntryAdapter
- All Implemented Interfaces:
FileEntry, WritableFileEntry, Container
- Enclosing class:
DiskFileStoreAdapter
public static class DiskFileStoreAdapter.DiskFileEntryAdapter
extends Object
implements WritableFileEntry
The
DiskFileEntryAdapter is a shim that allows a com.webcodepro.applecommander.storage.FileEntry
to be mapped into the new/evolving FileEntry / WritableFileEntry and associated interface(s).- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionDiskFileEntryAdapter(DiskFileStoreAdapter adapter, DiskFileStoreAdapter.DiskDirectoryAdapter parent, FileEntry fileEntry) -
Method Summary
Modifier and TypeMethodDescription<T> Optional<T> Return the type of content, if known.Return the file's data.Returns theFileStorethat thisEntryoriginates from.getName()Returns the name of this entry: either a directory name or a file name.The parentDirectory, if applicable.Interpret theFileEntryas if it were on a ProDOS volume.longgetSize()Returns the size, in bytes, of this item.booleanIndicates if thisFileEntryis deleted.voidsetDataFork(DataBuffer fileData) Store the file's data.voidAllows the name of this entry to be changed (depending on theCapabilityallowed by the underlyingFileStore).voidsetResourceFork(DataBuffer data) Store the resource fork data.Methods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface FileEntry
getResourceFork
-
Constructor Details
-
DiskFileEntryAdapter
public DiskFileEntryAdapter(DiskFileStoreAdapter adapter, DiskFileStoreAdapter.DiskDirectoryAdapter parent, FileEntry fileEntry)
-
-
Method Details
-
getParent
Description copied from interface:FileEntryThe parentDirectory, if applicable. Can returnnullif this is the root directory. -
getFileStore
Description copied from interface:FileEntryReturns theFileStorethat thisEntryoriginates from.- Specified by:
getFileStorein interfaceFileEntry
-
get
-
getDataFork
Description copied from interface:FileEntryReturn the file's data. This does not include any metadata that may be embedded with the file.- Specified by:
getDataForkin interfaceFileEntry
-
getProdosAttributes
Description copied from interface:FileEntryInterpret theFileEntryas if it were on a ProDOS volume. The intention is that ProDOS ended up being the common denominator in many tools and formats, so this allows each file store to manage the interpretation itself.- Specified by:
getProdosAttributesin interfaceFileEntry
-
setDataFork
Description copied from interface:WritableFileEntryStore the file's data. This does not include any metadata that may be embedded with the file.- Specified by:
setDataForkin interfaceWritableFileEntry
-
setResourceFork
Description copied from interface:WritableFileEntryStore the resource fork data. This may not be supported and may throw an exception.- Specified by:
setResourceForkin interfaceWritableFileEntry- See Also:
-
isDeleted
-
getName
Description copied from interface:FileEntryReturns the name of this entry: either a directory name or a file name. This does not contain any directory components -- strictly the name of this entry. Note that depending on context, this may be a computed field. -
setName
Description copied from interface:WritableFileEntryAllows the name of this entry to be changed (depending on theCapabilityallowed by the underlyingFileStore).- Specified by:
setNamein interfaceWritableFileEntry
-
getSize
-
getContentType
Description copied from interface:FileEntryReturn the type of content, if known. It should never return null; use UNKNOWN if not known.- Specified by:
getContentTypein interfaceFileEntry- See Also:
-