@Test public void testFindWildcard() throws Exception { final CommandLineParser parser = new PosixParser(); final CommandLine input = parser.parse(TerminalOptionsBuilder.options(), new String[]{"--delete", "rackspace: assertTrue(new DeletePathFinder().find(input, TerminalAction.delete, new Path("/remote/*.txt", EnumSet.of(Path.Type.file))).contains( new TransferItem(new Path("/remote", EnumSet.of(Path.Type.directory))) )); }
@Override public Set<TransferItem> find(final CommandLine input, final TerminalAction action, final Path remote) { if(StringUtils.containsAny(remote.getName(), '*')) { return Collections.singleton(new TransferItem(remote.getParent())); } return Collections.singleton(new TransferItem(remote)); }
DeletePathFinder implements TransferItemFinder { @Override public Set<TransferItem> find(final CommandLine input, final TerminalAction action, final Path remote) { if(StringUtils.containsAny(remote.getName(), '*')) { return Collections.singleton(new TransferItem(remote.getParent())); } return Collections.singleton(new TransferItem(remote)); } }
DeletePathFinder implements TransferItemFinder { @Override public Set<TransferItem> find(final CommandLine input, final TerminalAction action, final Path remote) { if(StringUtils.containsAny(remote.getName(), '*')) { return Collections.singleton(new TransferItem(remote.getParent())); } return Collections.singleton(new TransferItem(remote)); }  }
DeletePathFinder implements TransferItemFinder { @Override public Set<TransferItem> find(final CommandLine input, final TerminalAction action, final Path remote) { if(StringUtils.containsAny(remote.getName(), '*')) { return Collections.singleton(new TransferItem(remote.getParent())); } return Collections.singleton(new TransferItem(remote)); }  @Override Set<TransferItem> find(final CommandLine input, final TerminalAction action, final Path remote); }
DeletePathFinder implements TransferItemFinder { @Override public Set<TransferItem> find(final CommandLine input, final TerminalAction action, final Path remote) { if(StringUtils.containsAny(remote.getName(), '*')) { return Collections.singleton(new TransferItem(remote.getParent())); } return Collections.singleton(new TransferItem(remote)); }  @Override Set<TransferItem> find(final CommandLine input, final TerminalAction action, final Path remote);  }