destroydestiny commented on code in PR #300:
URL: https://github.com/apache/commons-vfs/pull/300#discussion_r974831684


##########
commons-vfs2/src/main/java/org/apache/commons/vfs2/provider/AbstractFileProvider.java:
##########
@@ -148,6 +148,21 @@ public void freeUnusedResources() {
                                       
.forEach(AbstractFileSystem::closeCommunicationLink);
     }
 
+    /**
+     * get snapshot of all fileSystem
+     *
+     * @return FileSystem Array
+     */
+    public AbstractFileSystem[] getAllFileSystemSnapshot() {

Review Comment:
   Hello @garydgregory 
   Thank for your review. This is the first time I have participated in an open 
source project. There are many things I don't know about in terms of 
specifications.
   This problem was encountered in my work, when 
FileSystemManager.freeUnusedResources, HttpFileSystem will close the 
httpClient, and using the httpClient again will report an error.
   I have two immature solutions.
   1、 Close the HttpFileSystem when FreeUnusedResources, because the httpClient 
it holds is closed and cannot be used again. with commit 
7d263eeda5c6a8b8261be22b1891ab330f9b3a06
   2、 httpclient shared ConnectionManager.  with commit 
7c09877efd490903289c44e504c48034f87f08f2
   I don't know enough about Common VFS, which is definitely not the optimal 
solution.
   
   This method copy from  
org.apache.commons.vfs2.provider.AbstractFileProvider#freeUnusedResources.  I 
just close FileSystem after closeCommunicationLink .
   if return a list.clone() , need to convert List<FileSystem>  to 
List<AbstractFileSystem> and why not create stream manually.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to