class SFTPDeleteFeature implements Delete {

    @Override
    public void delete(final Map<Path, TransferStatus> files, final PasswordCallback prompt, final Callback callback) throws BackgroundException {
        for(Path file : files.keySet()) {
            if(file.isFile() || file.isSymbolicLink()) {
                callback.delete(file);
                try {
                    session.sftp().remove(file.getAbsolute());
                }
                catch(IOException e) {
                    throw new SFTPExceptionMappingService().map("Cannot delete {0}", e, file);
                }
            }
        }
        for(Path file : files.keySet()) {
            if(file.isDirectory() && !file.isSymbolicLink()) {
                callback.delete(file);
                try {
                    session.sftp().removeDir(file.getAbsolute());
                }
                catch(IOException e) {
                    throw new SFTPExceptionMappingService().map("Cannot delete {0}", e, file);
                }
            }
        }
    }

    public  SFTPDeleteFeature(final SFTPSession session);

}