Exemple #1
0
        public FileStationAPI()
        {
            Authentication = APIAuthentication.CreateAPIAuthentication(Session);
            List <string> FileStationAPIs = new List <string>
            {
                FileStationList,
                FileStationSearch,
                FileStationUpload
            };
            ApiCollection apiCollection = ApiCollection.GetApiCollection();

            APIVersions = apiCollection.RetrieveLatestVersions(FileStationAPIs);
            SharedFoldersTopLevelData = new TopLevelSharedFolderListInfo();
            SharedFolders             = new List <FileStationSharedFolder>();
        }
Exemple #2
0
        public TopLevelSharedFolderListInfo RetrieveListOfSharedFolders()
        {
            Query = new Query();
            Query.SetPath("webapi/entry.cgi");
            NameValueCollection collection = new NameValueCollection();

            collection["_sid"] = SID;
            Query.BuildQueryWithParameters(FileStationList, APIVersions[FileStationList], "list_share", collection);
            NetworkRequest = new NetworkGetRequest(Query.GetUri());
            string jsonResponse = NetworkRequest.SendGetRequest();

            if (NetworkRequest.GetResponseStatusCode())
            {
                APITopLevelSharedFoldersNetworkResponse networkResponse = APIResult.RetrieveResultsOfSharedFoldersInfoNetworkResponse(jsonResponse);
                SharedFoldersTopLevelData = networkResponse.Data;
                PopulateSharedFolderCollection(SharedFoldersTopLevelData);
            }
            return(SharedFoldersTopLevelData);
        }
Exemple #3
0
 private void PopulateSharedFolderCollection(TopLevelSharedFolderListInfo data)
 {
     SharedFolders = data.Shares.Select(a => new FileStationSharedFolder(a)).ToList();
 }