@Override
    public Set<TransferItem> find(final CommandLine input, final TerminalAction action, final Path remote) {
        if(input.getOptionValues(action.name()).length == 2) {
            switch(action) {
                case download:
                    return new DownloadTransferItemFinder().find(input, action, remote);
                case upload:
                case synchronize:
                    return new UploadTransferItemFinder().find(input, action, remote);
            }
        }
        else {
            switch(action) {
                case upload:
                case synchronize:
                    return Collections.emptySet();
            }
        }
        // Relative to current working directory using prefix finder.
        return Collections.singleton(
                new TransferItem(remote, LocalFactory.get(prefixer.normalize(remote.getName())))
        );
    }
@Test
    public void testDownloadFileToDirectoryTarget() throws Exception {
        final CommandLineParser parser = new PosixParser();
        final String temp = System.getProperty("java.io.tmpdir");
        final CommandLine input = parser.parse(TerminalOptionsBuilder.options(), new String[]{"--download", "ftps://test.cyberduck.ch/remote/f", temp});

        final Set<TransferItem> found = new SingleTransferItemFinder().find(input, TerminalAction.download, new Path("/remote/f", EnumSet.of(Path.Type.file)));
        assertFalse(found.isEmpty());
        final Iterator<TransferItem> iter = found.iterator();
        assertEquals(new TransferItem(new Path("/remote/f", EnumSet.of(Path.Type.file)), LocalFactory.get(String.format("%s/f", temp))),
                iter.next());
    }