def convert()

in src/main/scala/com/gu/ssm/utils/FilePermissions.scala [44:53]


    def convert(perms: String): String = {
      require(perms.length == 4 || perms.length == 3, s"Permissions must have 3 or 4 digits, got [$perms]")
      // ignore setuid/setguid/sticky bit
      val i = if (perms.length == 3) 0 else 1
      val user = Character getNumericValue (perms charAt i)
      val group = Character getNumericValue (perms charAt i + 1)
      val other = Character getNumericValue (perms charAt i + 2)

      permissionAsString(user) + permissionAsString(group) + permissionAsString(other)
    }