public static async Task GetAclStatusAsync()

in AdlsDotNetSDK/Core.cs [1293:1379]


        public static async Task<AclStatus> GetAclStatusAsync(string path, UserGroupRepresentation? userIdFormat, AdlsClient client, RequestOptions req,
            OperationResponse resp, CancellationToken cancelToken = default(CancellationToken))
        {
            AclStatus status;
            QueryParams qp = new QueryParams();
            userIdFormat = userIdFormat ?? UserGroupRepresentation.ObjectID;
            qp.Add("tooid", Convert.ToString(userIdFormat == UserGroupRepresentation.ObjectID));
            var responseTuple = await WebTransport.MakeCallAsync("GETACLSTATUS", path, default(ByteBuffer), default(ByteBuffer), qp, client, req, resp, cancelToken).ConfigureAwait(false);
            if (!resp.IsSuccessful) return null;
            if (responseTuple != null)
            {
                try
                {
                    using (MemoryStream stream = new MemoryStream(responseTuple.Item1))
                    {
                        using (StreamReader stReader = new StreamReader(stream))
                        {
                            using (var jsonReader = new JsonTextReader(stReader))
                            {
                                List<AclEntry> entries = new List<AclEntry>();
                                string owner = "";
                                string group = "";
                                string permission = "";
                                bool stickyBit = false;
                                jsonReader.Read();//{ Start object
                                jsonReader.Read();//"AclStatus"
                                jsonReader.Read();//Start Object
                                do
                                {
                                    jsonReader.Read();
                                    if (jsonReader.TokenType.Equals(JsonToken.PropertyName))
                                    {
                                        if (((string)jsonReader.Value).Equals("entries"))
                                        {
                                            jsonReader.Read(); //Start of Array
                                            do
                                            {
                                                jsonReader.Read();
                                                if (!jsonReader.TokenType.Equals(JsonToken.EndArray))
                                                {
                                                    string entry = (string)jsonReader.Value;
                                                    entries.Add(AclEntry.ParseAclEntryString(entry, false));
                                                }
                                            } while (!jsonReader.TokenType.Equals(JsonToken.EndArray));
                                        }
                                        else if (((string)jsonReader.Value).Equals("owner"))
                                        {
                                            jsonReader.Read();
                                            owner = (string)jsonReader.Value;
                                        }
                                        else if (((string)jsonReader.Value).Equals("group"))
                                        {
                                            jsonReader.Read();
                                            group = (string)jsonReader.Value;
                                        }
                                        else if (((string)jsonReader.Value).Equals("permission"))
                                        {
                                            jsonReader.Read();
                                            permission = (string)jsonReader.Value;
                                        }
                                        else if (((string)jsonReader.Value).Equals("stickyBit"))
                                        {
                                            jsonReader.Read();
                                            stickyBit = (bool)jsonReader.Value;
                                        }
                                    }
                                } while (!jsonReader.TokenType.Equals(JsonToken.EndObject));
                                status = new AclStatus(entries, owner, group, permission, stickyBit);
                            }
                        }
                    }
                }
                catch (Exception ex)
                {
                    resp.IsSuccessful = false;
                    resp.Error = $"Unexpected problem with parsing JSON output. \r\nExceptionType: {ex.GetType()} \r\nExceptionMessage: {ex.Message}";
                    return null;
                }
            }
            else
            {
                resp.IsSuccessful = false;
                resp.Error = "The request is successful but the response is null";
                return null;
            }
            return status;
        }