@Override
    public TransferAction action(final Session<?> source, final Session<?> destination, final boolean resumeRequested, final boolean reloadRequested,
                                 final TransferPrompt prompt, final ListProgressListener listener) {
        if(log.isDebugEnabled()) {
            log.debug(String.format("Find transfer action with prompt %s", prompt));
        }
        if(resumeRequested) {
            if(action.equals(TransferAction.callback)) {
                return action = prompt.prompt(item);
            }
            return action;
        }
        // Prompt for synchronization.
        return action = prompt.prompt(item);
    }
@Test
    public void testAction() throws Exception {
        final Path p = new Path("t", EnumSet.of(Path.Type.directory));
        Transfer t = new SyncTransfer(new Host(new TestProtocol()), new TransferItem(p, new NullLocal("p", "t") {
            @Override
            public boolean exists() {
                return true;
            }

            @Override
            public AttributedList<Local> list() {
                return new AttributedList<>(Collections.singletonList(new NullLocal("p", "a")));
            }
        }));
        final AtomicBoolean prompt = new AtomicBoolean();
        final NullSession session = new NullSession(new Host(new TestProtocol()));
        assertNull(t.action(session, null, false, false, new DisabledTransferPrompt() {
            @Override
            public TransferAction prompt(final TransferItem file) {
                prompt.set(true);
                return null;
            }
        }, new DisabledListProgressListener()));
        assertTrue(prompt.get());
    }