@Override
    public void setUnixPermission(final Path file, final TransferStatus status) throws BackgroundException {
        final FileAttributes attr = new FileAttributes.Builder()
                .withPermissions(Integer.parseInt(status.getPermission().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);
        }
    }
@Test
    @Ignore
    public void testRetainStickyBits() throws Exception {
        final Path test = new Path(new SFTPHomeDirectoryService(session).find(), UUID.randomUUID().toString(), EnumSet.of(Path.Type.file));
        new SFTPTouchFeature(session).touch(test, new TransferStatus());
        final SFTPUnixPermissionFeature feature = new SFTPUnixPermissionFeature(session);
        feature.setUnixPermission(test,
            new Permission(Permission.Action.all, Permission.Action.read, Permission.Action.read,
                true, false, false));
        assertEquals(new Permission(Permission.Action.all, Permission.Action.read, Permission.Action.read,
            true, false, false), new SFTPListService(session).list(test.getParent(), new DisabledListProgressListener()).get(
            test).attributes().getPermission());
        feature.setUnixPermission(test,
            new Permission(Permission.Action.all, Permission.Action.read, Permission.Action.read,
                false, true, false));
        assertEquals(new Permission(Permission.Action.all, Permission.Action.read, Permission.Action.read,
            false, true, false), new SFTPListService(session).list(test.getParent(), new DisabledListProgressListener()).get(
            test).attributes().getPermission());
        feature.setUnixPermission(test,
            new Permission(Permission.Action.all, Permission.Action.read, Permission.Action.read,
                false, false, true));
        assertEquals(new Permission(Permission.Action.all, Permission.Action.read, Permission.Action.read,
            false, false, true), new SFTPListService(session).list(test.getParent(), new DisabledListProgressListener()).get(
            test).attributes().getPermission());
        new SFTPDeleteFeature(session).delete(Collections.<Path>singletonList(test), new DisabledLoginCallback(), new Delete.DisabledCallback());
    }