@@ -250,17 +250,23 @@ public AttributedList<Path> list(final Path directory, final ListProgressListene
250250 final String deepBoxNodeId = fileid .getDeepBoxNodeId (directory );
251251 final String boxNodeId = fileid .getBoxNodeId (directory );
252252 final Box box = rest .getBox (deepBoxNodeId , boxNodeId );
253- if (box .getBoxPolicy ().isCanListQueue ()) {
254- final Path inbox = new Path (directory , containerService .getPinnedLocalization (INBOX ), EnumSet .of (Path .Type .directory , Path .Type .volume ));
255- list .add (inbox .withAttributes (attributes .find (inbox )));
253+ if (HostPreferencesFactory .get (session .getHost ()).getBoolean ("deepbox.listing.box.inbox" )) {
254+ if (box .getBoxPolicy ().isCanListQueue ()) {
255+ final Path inbox = new Path (directory , containerService .getPinnedLocalization (INBOX ), EnumSet .of (Path .Type .directory , Path .Type .volume ));
256+ list .add (inbox .withAttributes (attributes .find (inbox )));
257+ }
256258 }
257- if (box .getBoxPolicy ().isCanListFilesRoot ()) {
258- final Path documents = new Path (directory , containerService .getPinnedLocalization (DOCUMENTS ), EnumSet .of (Path .Type .directory , Path .Type .volume ));
259- list .add (documents .withAttributes (attributes .find (documents )));
259+ if (HostPreferencesFactory .get (session .getHost ()).getBoolean ("deepbox.listing.box.documents" )) {
260+ if (box .getBoxPolicy ().isCanListFilesRoot ()) {
261+ final Path documents = new Path (directory , containerService .getPinnedLocalization (DOCUMENTS ), EnumSet .of (Path .Type .directory , Path .Type .volume ));
262+ list .add (documents .withAttributes (attributes .find (documents )));
263+ }
260264 }
261- if (box .getBoxPolicy ().isCanAccessTrash ()) {
262- final Path trash = new Path (directory , containerService .getPinnedLocalization (TRASH ), EnumSet .of (Path .Type .directory , Path .Type .volume ));
263- list .add (trash .withAttributes (attributes .find (trash )));
265+ if (HostPreferencesFactory .get (session .getHost ()).getBoolean ("deepbox.listing.box.trash" )) {
266+ if (box .getBoxPolicy ().isCanAccessTrash ()) {
267+ final Path trash = new Path (directory , containerService .getPinnedLocalization (TRASH ), EnumSet .of (Path .Type .directory , Path .Type .volume ));
268+ list .add (trash .withAttributes (attributes .find (trash )));
269+ }
264270 }
265271 listener .chunk (directory , list );
266272 return list ;
0 commit comments