Class AbstractVfsContainer

java.lang.Object
org.apache.commons.vfs2.provider.AbstractVfsComponent
org.apache.commons.vfs2.provider.AbstractVfsContainer
All Implemented Interfaces:
Closeable, AutoCloseable, VfsComponent
Direct Known Subclasses:
AbstractFileProvider, VirtualFileProvider

public abstract class AbstractVfsContainer extends AbstractVfsComponent
A VfsComponent that contains a set of sub-components.
  • Field Details

    • components

      private final ArrayList<Object> components
      The components contained by this component.
  • Constructor Details

    • AbstractVfsContainer

      public AbstractVfsContainer()
  • Method Details

    • addComponent

      protected void addComponent(Object component) throws FileSystemException
      Adds a sub-component to this component.

      If the sub-component implements VfsComponent, it is initialized. All sub-components are closed when this component is closed.

      Parameters:
      component - the component to add.
      Throws:
      FileSystemException - if any error occurs.
    • removeComponent

      protected void removeComponent(Object component)
      Removes a sub-component from this component.
      Parameters:
      component - the component to remove.
    • close

      public void close()
      Closes the sub-components of this component.
      Specified by:
      close in interface AutoCloseable
      Specified by:
      close in interface Closeable
      Specified by:
      close in interface VfsComponent
      Overrides:
      close in class AbstractVfsComponent