Class ProxyVFSSource

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

public class ProxyVFSSource extends AbstractVFSSource implements VFSParent
Class that wraps another source. Since a given source can only be mounted once due to the need to have a single parent, this allows the proxied source to be mounted in multiple locations at the same time. You cannot call getFullPath() on the proxied source as it has no parent, but you can call it on this proxy and it will work correctly.
Since:
1.0
Version:
2022-08-30
  • Constructor Details

    • ProxyVFSSource

      public ProxyVFSSource(VFSSource source)
      Constructs a proxy for the specified source.
  • 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
    • 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