public void close()

in commons-vfs2/src/main/java/org/apache/commons/vfs2/impl/DefaultFileSystemManager.java [339:399]


    public void close() {
        if (!init) {
            return;
        }

        // make sure all discovered components in
        // org.apache.commons.vfs2.impl.StandardFileSystemManager.configure(Element)
        // are closed here

        // Close the file system providers.
        providers.values().forEach(this::closeComponent);

        // Close the other components
        closeComponent(vfsProvider);
        closeComponent(fileReplicator);
        closeComponent(tempFileStore);
        closeComponent(defaultProvider);

        // unregister all providers here, so if any components have local file references
        // they can still resolve against the supported schemes
        providers.clear();

        // FileOperations are components, too
        operationProviders.values().forEach(opProviders -> opProviders.forEach(this::closeComponent));

        // unregister all
        operationProviders.clear();

        // collections with add()
        typeMap.clear();

        // Close cache last.
        closeComponent(filesCache);

        // should not happen, but make debugging easier:
        if (!components.isEmpty()) {
            log.warn("DefaultFilesystemManager.close: not all components are closed: " + components);
        }
        components.clear();

        // managed components
        vfsProvider = null;

        // virtual schemas
        virtualFileSystemSchemes.clear();

        // setters and derived state
        defaultProvider = null;
        baseFile = null;
        fileObjectDecorator = null;
        fileObjectDecoratorConst = null;
        localFileProvider = null;
        fileReplicator = null;
        tempFileStore = null;
        // setters with init() defaults
        filesCache = null;
        fileCacheStrategy = null;
        fileContentInfoFactory = null;

        init = false;
    }