/// <summary> /// Download zip archive of files found in repository-managed user directory. If the files parameter is null, all files in the directory are downloaded /// </summary> /// <param name="files">List of Repository file to delete</param> /// <returns>Byte arrary containing contents of downloaded zip file</returns> /// <remarks></remarks> public byte[] download(List <RRepositoryFile> files) { StringBuilder data = new StringBuilder(); StringBuilder filenames = new StringBuilder(); //set the url String uri = Constants.RREPOSITORYDIRECTORYDOWNLOAD; //create the input String data.Append(Constants.FORMAT_JSON); data.Append("&directory=" + HttpUtility.UrlEncode(m_directoryDetails.name)); if (!(files == null)) { foreach (var file in files) { if (filenames.Length != 0) { filenames.Append(","); filenames.Append(file.about().filename); } else { filenames.Append(file.about().filename); } } } data.Append("&filename=" + HttpUtility.UrlEncode(filenames.ToString())); //call the server byte[] returnValue = HTTPUtilities.callRESTBytesGet(uri, data.ToString(), ref m_client); return(returnValue); }