protected static TransferItem resolve(final Path remote, final Local local, final boolean append) {
        if(local.isDirectory()) {
            // Local path resolves to folder
            if(remote.isDirectory()) {
                if(append) {
                    return new TransferItem(new Path(remote, local.getName(), EnumSet.of(Path.Type.directory)), local);
                }
            }
            // Append local name to remote target
            return new TransferItem(remote, local);
        }
        // Local path resolves to file
        if(remote.isDirectory()) {
            // Append local name to remote target
            return new TransferItem(new Path(remote, local.getName(), EnumSet.of(Path.Type.file)), local);
        }
        // Keep from input for file transfer
        return new TransferItem(remote, local);
    }
@Test
    public void testResolveFileToFile() {
        final Local temp = new FlatTemporaryFileService().create(new AlphanumericRandomStringService().random());
        final Path file = new Path("/f", EnumSet.of(Path.Type.file));
        final TransferItem item = UploadTransferItemFinder.resolve(file, temp, false);
        assertEquals(file, item.remote);
        assertEquals(temp, item.local);
    }