code: public void disconnect() {
      Thread closeThread = new Thread() {
        /* @inheritDoc */
        @Override
        public void run() {
          try {
            System.out.printf("Closing all opened File Systems...\n");
            FileSystem.closeAll();
            System.out.printf("File Systems closed\n");
  
          } catch (IOException ioe) {
            ioe.printStackTrace();
          }
        }
      };
  
      // Wait 5 seconds for the connections to be closed
      closeThread.start();
      try {
        closeThread.join(5000);
  
      } catch (InterruptedException ie) {
        // Ignore
      }
    }
docs: /*
  Actions