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 sub-components.-
Field Summary
FieldsModifier and TypeFieldDescriptionThe components contained by this component. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected voidaddComponent(Object component) Adds a sub-component to this component.voidclose()Closes the sub-components of this component.protected voidremoveComponent(Object component) Removes a sub-component from this component.Methods inherited from class org.apache.commons.vfs2.provider.AbstractVfsComponent
getContext, getLogger, init, setContext, setLogger
-
Field Details
-
components
The components contained by this component.
-
-
Constructor Details
-
AbstractVfsContainer
public AbstractVfsContainer()
-
-
Method Details
-
addComponent
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
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:
closein interfaceAutoCloseable- Specified by:
closein interfaceCloseable- Specified by:
closein interfaceVfsComponent- Overrides:
closein classAbstractVfsComponent
-