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 void
addComponent
(Object component) Adds a subcomponent to this component.void
close()
Closes the subcomponents of this component.protected void
removeComponent
(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:
close
in interfaceAutoCloseable
- Specified by:
close
in interfaceCloseable
- Specified by:
close
in interfaceVfsComponent
- Overrides:
close
in classAbstractVfsComponent
-
removeComponent
Removes a subcomponent from this component.- Parameters:
component
- the component to remove.
-