Package org.apache.commons.vfs2.provider
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
A
VfsComponent that contains a set of subcomponents.-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected voidaddComponent(Object component) Adds a subcomponent to this component.voidclose()Closes the subcomponents of this component.protected voidremoveComponent(Object component) Removes a subcomponent from this component.Methods inherited from class org.apache.commons.vfs2.provider.AbstractVfsComponent
getContext, getLogger, init, setContext, setLogger
-
Constructor Details
-
AbstractVfsContainer
public AbstractVfsContainer()Constructs a new instance for subclasses.
-
-
Method Details
-
addComponent
Adds a subcomponent 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.
-
close
Closes the subcomponents of this component.- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceCloseable- Specified by:
closein interfaceVfsComponent- Overrides:
closein classAbstractVfsComponent
-
removeComponent
Removes a subcomponent from this component.- Parameters:
component- the component to remove.
-