SftpFileMode constructor

SftpFileMode({
  1. bool userRead = true,
  2. bool userWrite = true,
  3. bool userExecute = true,
  4. bool groupRead = true,
  5. bool groupWrite = true,
  6. bool groupExecute = true,
  7. bool otherRead = true,
  8. bool otherWrite = true,
  9. bool otherExecute = true,
})

Implementation

factory SftpFileMode({
  bool userRead = true,
  bool userWrite = true,
  bool userExecute = true,
  bool groupRead = true,
  bool groupWrite = true,
  bool groupExecute = true,
  bool otherRead = true,
  bool otherWrite = true,
  bool otherExecute = true,
}) {
  var flags = 0;
  if (userRead) flags |= _PermissionFlags.userRead;
  if (userWrite) flags |= _PermissionFlags.userWrite;
  if (userExecute) flags |= _PermissionFlags.userExecute;
  if (groupRead) flags |= _PermissionFlags.groupRead;
  if (groupWrite) flags |= _PermissionFlags.groupWrite;
  if (groupExecute) flags |= _PermissionFlags.groupExecute;
  if (otherRead) flags |= _PermissionFlags.otherRead;
  if (otherWrite) flags |= _PermissionFlags.otherWrite;
  if (otherExecute) flags |= _PermissionFlags.otherExecute;
  return SftpFileMode.value(flags);
}