Class DiskFileStoreAdapter

java.lang.Object
com.webcodepro.applecommander.storage.DiskFileStoreAdapter
All Implemented Interfaces:
CapabilityProvider, FileStore, Container, InformationProvider

public class DiskFileStoreAdapter extends Object implements FileStore
The DiskFileStoreAdapter is a shim that allows FormattedDisk to be mapped into the new/evolving FileStore and associated interface(s). The intent is that this is a short-term strategy.
See Also:
  • Constructor Details

    • DiskFileStoreAdapter

      public DiskFileStoreAdapter(FormattedDisk disk)
  • Method Details

    • get

      public <T> Optional<T> get(Class<T> iface)
      Specified by:
      get in interface Container
    • getLabel

      public String getLabel()
      Description copied from interface: FileStore
      The label is a mechanism to distinguish multiple file stores in a single file. For instance, UniDOS has two file stores in the file, so it would have two different labels such as "Disk 1" and "Disk 2".
      Specified by:
      getLabel in interface FileStore
    • getRootDirectory

      public DiskFileStoreAdapter.DiskDirectoryAdapter getRootDirectory()
      Description copied from interface: FileStore
      All FileStores support a "root" directory that references all files.
      Specified by:
      getRootDirectory in interface FileStore
    • getPathSeparator

      public String getPathSeparator()
      Description copied from interface: FileStore
      This is the path separator character.
      Specified by:
      getPathSeparator in interface FileStore
    • can

      public boolean can(Capability capability)
      Description copied from interface: CapabilityProvider
      Helps identify capabilities of the existing component.
      Specified by:
      can in interface CapabilityProvider
    • getDisplayColumns

      public List<DisplayColumn> getDisplayColumns()
      Translate the "legacy" FormattedDisk FileColumnHeader to the new DisplayColumn structure. Note that we need to track what has been seen as well as where it comes from and the index values in order to replicate most of the capability. This does not solve for type since the old API pre-formats everything as a String.
      Specified by:
      getDisplayColumns in interface FileStore
    • information

      public List<InformationGroup> information()
      Specified by:
      information in interface InformationProvider