public FileMode(int mask) { this.mask = mask; this.type = Type.fromMask(getTypeMask()); this.perms = FilePermission.fromMask(getPermissionsMask()); }
public Builder withType(FileMode.Type type) { mask |= Flag.MODE.get(); this.mode = new FileMode(type.toMask() | (mode != null ? mode.getPermissionsMask() : 0)); return this; }
private void copyAttributes(final RemoteResourceInfo remote, final LocalDestFile local) throws IOException { final FileAttributes attrs = remote.getAttributes(); local.setPermissions(attrs.getMode().getPermissionsMask()); if (attrs.has(FileAttributes.Flag.ACMODTIME)) { local.setLastAccessedTime(attrs.getAtime()); local.setLastModifiedTime(attrs.getMtime()); } }
public FileMode(int mask) { this.mask = mask; this.type = Type.fromMask(getTypeMask()); this.perms = FilePermission.fromMask(getPermissionsMask()); }
public Builder withType(FileMode.Type type) { mask |= Flag.MODE.get(); this.mode = new FileMode(type.toMask() | (mode != null ? mode.getPermissionsMask() : 0)); return this; }
public FileMode(int mask) { this.mask = mask; this.type = Type.fromMask(getTypeMask()); this.perms = FilePermission.fromMask(getPermissionsMask()); }
public Builder withType(FileMode.Type type) { mask |= Flag.MODE.get(); this.mode = new FileMode(type.toMask() | (mode != null ? mode.getPermissionsMask() : 0)); return this; }
private void copyAttributes(final RemoteResourceInfo remote, final LocalDestFile local) throws IOException { final FileAttributes attrs = remote.getAttributes(); local.setPermissions(attrs.getMode().getPermissionsMask()); if (attrs.has(FileAttributes.Flag.ACMODTIME)) { local.setLastAccessedTime(attrs.getAtime()); local.setLastModifiedTime(attrs.getMtime()); } }
public PathAttributes toAttributes(final FileAttributes stat) { final PathAttributes attributes = new PathAttributes(); switch(stat.getType()) { case REGULAR: case UNKNOWN: attributes.setSize(stat.getSize()); } if(0 != stat.getMode().getPermissionsMask()) { attributes.setPermission(new Permission(Integer.toString(stat.getMode().getPermissionsMask(), 8))); } if(0 != stat.getUID()) { attributes.setOwner(String.valueOf(stat.getUID())); } if(0 != stat.getGID()) { attributes.setGroup(String.valueOf(stat.getGID())); } if(0 != stat.getMtime()) { attributes.setModificationDate(stat.getMtime() * 1000L); } if(0 != stat.getAtime()) { attributes.setAccessedDate(stat.getAtime() * 1000L); } return attributes; } }
private void copyAttributes(final RemoteResourceInfo remote, final LocalDestFile local) throws IOException { final FileAttributes attrs = remote.getAttributes(); local.setPermissions(attrs.getMode().getPermissionsMask()); if (attrs.has(FileAttributes.Flag.ACMODTIME)) { local.setLastAccessedTime(attrs.getAtime()); local.setLastModifiedTime(attrs.getMtime()); } }