Interface FileEntry
- All Superinterfaces:
Container
- All Known Subinterfaces:
WritableFileEntry
- All Known Implementing Classes:
AppleArchiveFormatFileEntry, DiskFileStoreAdapter.DiskFileEntryAdapter, GamedosFileEntry, ShrinkitFileEntry, ZipFileEntry
A
FileEntry represents a single file in a file store.
The generic interface is intentionally spare to keep useless methods to a minimum.-
Method Summary
Modifier and TypeMethodDescriptiondefault ContentTypeReturn 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.default Optional<DataBuffer> Return the resource fork data.longgetSize()Returns the size, in bytes, of this item.booleanIndicates if thisFileEntryis deleted.
-
Method Details
-
getParent
Directory getParent()The parentDirectory, if applicable. Can returnnullif this is the root directory. -
isDeleted
boolean isDeleted()Indicates if thisFileEntryis deleted. -
getFileStore
FileStore getFileStore()Returns theFileStorethat thisEntryoriginates from. -
getName
String getName()Returns 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. -
getSize
long getSize()Returns the size, in bytes, of this item. It may be approximate (based off a sector count, for instance). -
getDataFork
DataBuffer getDataFork()Return the file's data. This does not include any metadata that may be embedded with the file. -
getProdosAttributes
ProdosAttributes getProdosAttributes()Interpret 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. -
getResourceFork
Return the resource fork data. If there is no resource fork (or a resource fork is not supported), then this returns an emptyOptional. -
getContentType
Return the type of content, if known. It should never return null; use UNKNOWN if not known.- See Also:
-