1818 */
1919
2020import ch .cyberduck .core .AbstractHostCollection ;
21- import ch .cyberduck .core .AttributedList ;
2221import ch .cyberduck .core .BookmarkCollection ;
2322import ch .cyberduck .core .Cache ;
2423import ch .cyberduck .core .HistoryCollection ;
@@ -62,10 +61,8 @@ public Path run(final Session<?> session) throws BackgroundException {
6261 }
6362
6463 protected Path list (final Session <?> session , final Home feature ) throws BackgroundException {
65- Path home ;
66- AttributedList <Path > list ;
6764 try {
68- home = feature .find ();
65+ final Path home = feature .find ();
6966 if (log .isInfoEnabled ()) {
7067 log .info (String .format ("Mount path %s" , home ));
7168 }
@@ -74,7 +71,8 @@ protected Path list(final Session<?> session, final Home feature) throws Backgro
7471 // Retrieve directory listing of default path
7572 final SessionListWorker worker = new SessionListWorker (cache , home , listener );
7673 listener .message (worker .getActivity ());
77- list = worker .run (session );
74+ cache .put (home , worker .run (session ));
75+ return home ;
7876 }
7977 catch (NotfoundException e ) {
8078 if (log .isWarnEnabled ()) {
@@ -85,7 +83,7 @@ protected Path list(final Session<?> session, final Home feature) throws Backgro
8583 }
8684 // The default path does not exist or is not readable due to possible permission issues. Fallback
8785 // to default working directory
88- home = new Path (String .valueOf (Path .DELIMITER ), EnumSet .of (Path .Type .volume , Path .Type .directory ));
86+ final Path home = new Path (String .valueOf (Path .DELIMITER ), EnumSet .of (Path .Type .volume , Path .Type .directory ));
8987 if (log .isInfoEnabled ()) {
9088 log .info (String .format ("Fallback to mount path %s" , home ));
9189 }
@@ -94,10 +92,9 @@ protected Path list(final Session<?> session, final Home feature) throws Backgro
9492 // Retrieve directory listing of working directory
9593 final SessionListWorker worker = new SessionListWorker (cache , home , listener );
9694 listener .message (worker .getActivity ());
97- list = worker .run (session );
95+ cache .put (home , worker .run (session ));
96+ return home ;
9897 }
99- cache .put (home , list );
100- return home ;
10198 }
10299
103100 @ Override
0 commit comments