@Test(expected = NotfoundException.class) public void testListNotfound() throws Exception { final Path f = new Path(UUID.randomUUID().toString(), EnumSet.of(Path.Type.directory)); final FTPListService service = new FTPListService(session, null, TimeZone.getDefault()); service.list(f, new DisabledListProgressListener()); }
@Override public AttributedList<Path> list(final Path directory, final ListProgressListener listener) throws BackgroundException { try { if(implementations.containsKey(Command.mlsd)) { if(session.getClient().hasFeature(FTPCmd.MLST.getCommand())) { try { return this.post(directory, implementations.get(Command.mlsd).list(directory, listener), listener); } catch(InteroperabilityException | FTPInvalidListException e) { this.remove(Command.mlsd); } } else { this.remove(Command.mlsd); } } if(implementations.containsKey(Command.stat)) { try { return this.post(directory, implementations.get(Command.stat).list(directory, listener), listener); } catch(FTPInvalidListException | InteroperabilityException | AccessDeniedException | NotfoundException e) { this.remove(Command.stat); } } if(implementations.containsKey(Command.lista)) { try { return this.post(directory, implementations.get(Command.lista).list(directory, listener), listener); } catch(InteroperabilityException e) { this.remove(Command.lista); } catch(FTPInvalidListException e) { } } try { return this.post(directory, implementations.get(Command.list).list(directory, listener), listener); } catch(FTPInvalidListException f) { return this.post(directory, f.getParsed(), listener); } } catch(IOException e) { throw new FTPExceptionMappingService().map("Listing directory {0} failed", e, directory); } }
FTPListService implements ListService { @Override public AttributedList<Path> list(final Path directory, final ListProgressListener listener) throws BackgroundException { try { if(implementations.containsKey(Command.mlsd)) { if(session.getClient().hasFeature(FTPCmd.MLST.getCommand())) { try { return this.post(directory, implementations.get(Command.mlsd).list(directory, listener), listener); } catch(InteroperabilityException | FTPInvalidListException e) { this.remove(Command.mlsd); } } else { this.remove(Command.mlsd); } } if(implementations.containsKey(Command.stat)) { try { return this.post(directory, implementations.get(Command.stat).list(directory, listener), listener); } catch(FTPInvalidListException | InteroperabilityException | AccessDeniedException | NotfoundException e) { this.remove(Command.stat); } } if(implementations.containsKey(Command.lista)) { try { return this.post(directory, implementations.get(Command.lista).list(directory, listener), listener); } catch(InteroperabilityException e) { this.remove(Command.lista); } catch(FTPInvalidListException e) { } } try { return this.post(directory, implementations.get(Command.list).list(directory, listener), listener); } catch(FTPInvalidListException f) { return this.post(directory, f.getParsed(), listener); } } catch(IOException e) { throw new FTPExceptionMappingService().map("Listing directory {0} failed", e, directory); } } }
FTPListService implements ListService { @Override public AttributedList<Path> list(final Path directory, final ListProgressListener listener) throws BackgroundException { try { if(implementations.containsKey(Command.mlsd)) { if(session.getClient().hasFeature(FTPCmd.MLST.getCommand())) { try { return this.post(directory, implementations.get(Command.mlsd).list(directory, listener), listener); } catch(InteroperabilityException | FTPInvalidListException e) { this.remove(Command.mlsd); } } else { this.remove(Command.mlsd); } } if(implementations.containsKey(Command.stat)) { try { return this.post(directory, implementations.get(Command.stat).list(directory, listener), listener); } catch(FTPInvalidListException | InteroperabilityException | AccessDeniedException | NotfoundException e) { this.remove(Command.stat); } } if(implementations.containsKey(Command.lista)) { try { return this.post(directory, implementations.get(Command.lista).list(directory, listener), listener); } catch(InteroperabilityException e) { this.remove(Command.lista); } catch(FTPInvalidListException e) { } } try { return this.post(directory, implementations.get(Command.list).list(directory, listener), listener); } catch(FTPInvalidListException f) { return this.post(directory, f.getParsed(), listener); } } catch(IOException e) { throw new FTPExceptionMappingService().map("Listing directory {0} failed", e, directory); } } FTPListService(final FTPSession session, final String system, final TimeZone zone); }
FTPListService implements ListService { @Override public AttributedList<Path> list(final Path directory, final ListProgressListener listener) throws BackgroundException { try { if(implementations.containsKey(Command.mlsd)) { if(session.getClient().hasFeature(FTPCmd.MLST.getCommand())) { try { return this.post(directory, implementations.get(Command.mlsd).list(directory, listener), listener); } catch(InteroperabilityException | FTPInvalidListException e) { this.remove(Command.mlsd); } } else { this.remove(Command.mlsd); } } if(implementations.containsKey(Command.stat)) { try { return this.post(directory, implementations.get(Command.stat).list(directory, listener), listener); } catch(FTPInvalidListException | InteroperabilityException | AccessDeniedException | NotfoundException e) { this.remove(Command.stat); } } if(implementations.containsKey(Command.lista)) { try { return this.post(directory, implementations.get(Command.lista).list(directory, listener), listener); } catch(InteroperabilityException e) { this.remove(Command.lista); } catch(FTPInvalidListException e) { } } try { return this.post(directory, implementations.get(Command.list).list(directory, listener), listener); } catch(FTPInvalidListException f) { return this.post(directory, f.getParsed(), listener); } } catch(IOException e) { throw new FTPExceptionMappingService().map("Listing directory {0} failed", e, directory); } } FTPListService(final FTPSession session, final String system, final TimeZone zone); @Override AttributedList<Path> list(final Path directory, final ListProgressListener listener); }
FTPListService implements ListService { @Override public AttributedList<Path> list(final Path directory, final ListProgressListener listener) throws BackgroundException { try { if(implementations.containsKey(Command.mlsd)) { if(session.getClient().hasFeature(FTPCmd.MLST.getCommand())) { try { return this.post(directory, implementations.get(Command.mlsd).list(directory, listener), listener); } catch(InteroperabilityException | FTPInvalidListException e) { this.remove(Command.mlsd); } } else { this.remove(Command.mlsd); } } if(implementations.containsKey(Command.stat)) { try { return this.post(directory, implementations.get(Command.stat).list(directory, listener), listener); } catch(FTPInvalidListException | InteroperabilityException | AccessDeniedException | NotfoundException e) { this.remove(Command.stat); } } if(implementations.containsKey(Command.lista)) { try { return this.post(directory, implementations.get(Command.lista).list(directory, listener), listener); } catch(InteroperabilityException e) { this.remove(Command.lista); } catch(FTPInvalidListException e) { } } try { return this.post(directory, implementations.get(Command.list).list(directory, listener), listener); } catch(FTPInvalidListException f) { return this.post(directory, f.getParsed(), listener); } } catch(IOException e) { throw new FTPExceptionMappingService().map("Listing directory {0} failed", e, directory); } } FTPListService(final FTPSession session, final String system, final TimeZone zone); @Override AttributedList<Path> list(final Path directory, final ListProgressListener listener);  }