Beispiel #1
0
        /// <summary>Sets the specified property on the specfied path to value</summary>
        /// <remarks>Use <see cref="DeleteProperty(string,string, SvnSetPropertyArgs)" /> to remove an existing property</remarks>
        public bool SetProperty(string target, string propertyName, string value, SvnSetPropertyArgs args)
        {
            if (string.IsNullOrEmpty(target))
            {
                throw new ArgumentNullException(nameof(target));
            }
            if (string.IsNullOrEmpty(propertyName))
            {
                throw new ArgumentNullException(nameof(propertyName));
            }
            if (!IsNotUri(target))
            {
                throw new ArgumentException(SharpSvnStrings.ArgumentMustBeAPathNotAUri, nameof(target));
            }
            if (args == null)
            {
                throw new ArgumentNullException(nameof(args));
            }
            if (value == null)
            {
                throw new ArgumentNullException(nameof(value));
            }

            using var pool = new AprPool(_pool);

            return(InternalSetProperty(
                       target,
                       propertyName,
                       pool.AllocPropertyValue(value, propertyName),
                       args,
                       pool));
        }