@Test @Ignore public void testSetUnixGroup() throws Exception { final Path home = new SFTPHomeDirectoryService(session).find(); final long modified = System.currentTimeMillis(); final Path test = new Path(home, "test", EnumSet.of(Path.Type.file)); new SFTPUnixPermissionFeature(session).setUnixGroup(test, "80"); assertEquals("80", new SFTPListService(session).list(home, new DisabledListProgressListener()).get(test).attributes().getGroup()); }
@Override public void setUnixGroup(final Path file, final String group) throws BackgroundException { final FileAttributes attr = new FileAttributes.Builder() .withUIDGID(0, new Integer(group)) .build(); try { session.sftp().setAttributes(file.getAbsolute(), attr); } catch(IOException e) { throw new SFTPExceptionMappingService().map("Failure to write attributes of {0}", e, file); } }
SFTPUnixPermissionFeature extends DefaultUnixPermissionFeature implements UnixPermission { @Override public void setUnixGroup(final Path file, final String group) throws BackgroundException { final FileAttributes attr = new FileAttributes.Builder() .withUIDGID(0, new Integer(group)) .build(); try { session.sftp().setAttributes(file.getAbsolute(), attr); } catch(IOException e) { throw new SFTPExceptionMappingService().map("Failure to write attributes of {0}", e, file); } } }
SFTPUnixPermissionFeature extends DefaultUnixPermissionFeature implements UnixPermission { @Override public void setUnixGroup(final Path file, final String group) throws BackgroundException { final FileAttributes attr = new FileAttributes.Builder() .withUIDGID(0, new Integer(group)) .build(); try { session.sftp().setAttributes(file.getAbsolute(), attr); } catch(IOException e) { throw new SFTPExceptionMappingService().map("Failure to write attributes of {0}", e, file); } } SFTPUnixPermissionFeature(final SFTPSession session); }
SFTPUnixPermissionFeature extends DefaultUnixPermissionFeature implements UnixPermission { @Override public void setUnixGroup(final Path file, final String group) throws BackgroundException { final FileAttributes attr = new FileAttributes.Builder() .withUIDGID(0, new Integer(group)) .build(); try { session.sftp().setAttributes(file.getAbsolute(), attr); } catch(IOException e) { throw new SFTPExceptionMappingService().map("Failure to write attributes of {0}", e, file); } } SFTPUnixPermissionFeature(final SFTPSession session); @Override void setUnixOwner(final Path file, final String owner); @Override void setUnixGroup(final Path file, final String group); @Override Permission getUnixPermission(final Path file); @Override void setUnixPermission(final Path file, final Permission permission); }
SFTPUnixPermissionFeature extends DefaultUnixPermissionFeature implements UnixPermission { @Override public void setUnixGroup(final Path file, final String group) throws BackgroundException { final FileAttributes attr = new FileAttributes.Builder() .withUIDGID(0, new Integer(group)) .build(); try { session.sftp().setAttributes(file.getAbsolute(), attr); } catch(IOException e) { throw new SFTPExceptionMappingService().map("Failure to write attributes of {0}", e, file); } } SFTPUnixPermissionFeature(final SFTPSession session); @Override void setUnixOwner(final Path file, final String owner); @Override void setUnixGroup(final Path file, final String group); @Override Permission getUnixPermission(final Path file); @Override void setUnixPermission(final Path file, final Permission permission);  }