Class StackedVFSSource

java.lang.Object
com.tccc.kos.commons.core.vfs.AbstractVFSSource
com.tccc.kos.commons.core.vfs.StackedVFSSource
All Implemented Interfaces:
VFSParent, VFSSource

public class StackedVFSSource extends AbstractVFSSource implements VFSParent
Implementation of VFSSource that supports stacked sources. This source can be mounted but then sources can be added and removed from this source as a priority order stack.
Since:
1.0
Version:
2022-08-30
  • Constructor Details

    • StackedVFSSource

      public StackedVFSSource()
      Constructs a new instance.
  • Method Details

    • getInputStream

      public InputStream getInputStream(String path)
      Retrieves the input stream for the given path.
      Specified by:
      getInputStream in interface VFSSource
      Parameters:
      path - the requested path
      Returns:
      the input stream
    • push

      public void push(VFSSource source)
      Pushes a new source as the top overlay.
      Parameters:
      source - the source to put at the top of the list
    • remove

      public void remove(VFSSource source)
      Removes the specified source from the list.
      Parameters:
      source - the source to remove
    • getBasePath

      public String getBasePath(VFSSource source)
      Returns the base path to the specified VFSSource.
      Specified by:
      getBasePath in interface VFSParent
      Parameters:
      source - the source to return the base path for
      Returns:
      the base path to the source