class SFTPUnixPermissionFeature extends DefaultUnixPermissionFeature implements UnixPermission {

    @Override
    public void setUnixPermission(final Path file, final Permission permission) throws BackgroundException {
        final FileAttributes attr = new FileAttributes.Builder()
                .withPermissions(Integer.parseInt(permission.getMode(), 8))
                .build();
        try {
            session.sftp().setAttributes(file.getAbsolute(), attr);
        }
        catch(IOException e) {
            throw new SFTPExceptionMappingService().map("Failure to write attributes of {0}", e, file);
        }
    }

    public  SFTPUnixPermissionFeature(final SFTPSession session);

}