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:
java.io.Closeable,java.lang.AutoCloseable,VfsComponent
- Direct Known Subclasses:
AbstractFileProvider,VirtualFileProvider
public abstract class AbstractVfsContainer extends AbstractVfsComponent
AVfsComponentthat contains a set of subcomponents.
-
-
Constructor Summary
Constructors Constructor Description AbstractVfsContainer()Constructs a new instance for subclasses.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected voidaddComponent(java.lang.Object component)Adds a subcomponent to this component.voidclose()Closes the subcomponents of this component.protected voidremoveComponent(java.lang.Object component)Removes a subcomponent from this component.-
Methods inherited from class org.apache.commons.vfs2.provider.AbstractVfsComponent
getContext, getLogger, init, setContext, setLogger
-
-
-
-
Constructor Detail
-
AbstractVfsContainer
public AbstractVfsContainer()
Constructs a new instance for subclasses.
-
-
Method Detail
-
addComponent
protected void addComponent(java.lang.Object component) throws FileSystemException
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
public void close()
Closes the subcomponents of this component.- Specified by:
closein interfacejava.lang.AutoCloseable- Specified by:
closein interfacejava.io.Closeable- Specified by:
closein interfaceVfsComponent- Overrides:
closein classAbstractVfsComponent
-
removeComponent
protected void removeComponent(java.lang.Object component)
Removes a subcomponent from this component.- Parameters:
component- the component to remove.
-
-