/// <summary> /// Update access-controls on files found in repository-managed user directory. If the files parameter is null, all files in the directory are updated. /// </summary> /// <param name="accessControls">RepoAccessControlOptions object to apply to the files</param> /// <param name="files">List of Repository file to update</param> /// <remarks></remarks> public void update(RepoAccessControlOptions accessControls, List <RRepositoryFile> files) { StringBuilder data = new StringBuilder(); StringBuilder filenames = new StringBuilder(); //set the url String uri = Constants.RREPOSITORYDIRECTORYUPDATE; //create the input String data.Append(Constants.FORMAT_JSON); data.Append("&directory=" + HttpUtility.UrlEncode(m_directoryDetails.name)); data.Append("&shared=" + HttpUtility.UrlEncode(accessControls.sharedUser.ToString())); data.Append("&restricted=" + HttpUtility.UrlEncode(accessControls.restricted)); data.Append("&published=" + HttpUtility.UrlEncode(accessControls.published.ToString())); 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 JSONResponse jresponse = HTTPUtilities.callRESTPost(uri, data.ToString(), ref m_client); }
/// <summary> /// Update access-controls on files found in repository-managed user directory. If the files parameter is null, all files in the directory are updated. /// </summary> /// <param name="accessControls">RepoAccessControlOptions object to apply to the files</param> /// <param name="files">List of Repository file to update</param> /// <remarks></remarks> public void update(RepoAccessControlOptions accessControls, List<RRepositoryFile> files) { StringBuilder data = new StringBuilder(); StringBuilder filenames = new StringBuilder(); //set the url String uri = Constants.RREPOSITORYDIRECTORYUPDATE; //create the input String data.Append(Constants.FORMAT_JSON); data.Append("&directory=" + HttpUtility.UrlEncode(m_directoryDetails.name)); data.Append("&shared=" + HttpUtility.UrlEncode(accessControls.sharedUser.ToString())); data.Append("&restricted=" + HttpUtility.UrlEncode(accessControls.restricted)); data.Append("&published=" + HttpUtility.UrlEncode(accessControls.published.ToString())); 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 JSONResponse jresponse = HTTPUtilities.callRESTPost(uri, data.ToString(), ref m_client); }