public List <HubicFolderInfo> GetFiles(HubicFolderInfo fileInfo) { if (!CheckAuthorization()) { return(null); } string response = SendRequest(HttpMethod.GET, HubicOpenstackAuthInfo.endpoint + "/default" + "/?path=" + fileInfo.name + "&format=json", headers: GetAuthHeaders("X-Auth-Token")); if (!string.IsNullOrEmpty(response)) { return(JsonConvert.DeserializeObject <List <HubicFolderInfo> >(response)); } return(null); }
private void HubicAddFolder(HubicFolderInfo folder) { ListViewItem lvi = new ListViewItem(folder.name); lvi.Tag = folder; lvHubicFolders.Items.Add(lvi); }
public void HubicListFolders(HubicFolderInfo fileInfo) { lvHubicFolders.Items.Clear(); if (!OAuth2Info.CheckOAuth(Config.HubicOAuth2Info)) { MessageBox.Show(Resources.UploadersConfigForm_ListFolders_Authentication_required_, Resources.UploadersConfigForm_HubicListFolders_Hubic_refresh_folders_list_failed, MessageBoxButtons.OK, MessageBoxIcon.Warning); } else { Hubic hubic = new Hubic(Config.HubicOAuth2Info, Config.HubicOpenstackAuthInfo); List<HubicFolderInfo> folders = hubic.GetFiles(fileInfo); if (folders != null && folders.Count != 0) { foreach (HubicFolderInfo folder in folders.Where(x => x.content_type == "application/directory" && x.name[0] != '.')) { HubicAddFolder(folder); } } } }
public List<HubicFolderInfo> GetFiles(HubicFolderInfo fileInfo) { if (!CheckAuthorization()) { return null; } string response = SendRequest(HttpMethod.GET, HubicOpenstackAuthInfo.endpoint + "/default" + "/?path=" + fileInfo.name + "&format=json", headers: GetAuthHeaders("X-Auth-Token")); if (!string.IsNullOrEmpty(response)) { return JsonConvert.DeserializeObject<List<HubicFolderInfo>>(response); } return null; }