Exemple #1
0
 /// <summary>
 /// AppendFileRangeToBody() is used to append part or
 /// all of a file, to be uploaded, to the request body. A content-length
 /// request header will be automatically generated.
 /// </summary>
 /// <param name="fileRef">A <code>FileRef</code> containing the file
 /// reference.</param>
 /// <param name="startOffset">An optional starting point offset within the
 /// file.</param>
 /// <param name="length">An optional number of bytes of the file to
 /// be included. If the value is -1, then the sub-range to upload extends
 /// to the end of the file.</param>
 /// <param name="utcExpectedLastModifiedTime">An optional last
 /// modified time stamp used to validate that the file was not modified since
 /// the given time before it was uploaded. The upload will fail with an error
 /// code of <code>ErrorFilechanged</code> if the file has been modified
 /// since the given time. If utcExpectedLastModifiedTime is null, then no
 /// validation is performed.</param>
 /// <returns>true if successful, false if any of the parameters are invalid.</returns>
 public bool AppendFileRangeToBody(FileRef fileRef,
                                   long startOffset,
                                   long length,
                                   DateTime?utcExpectedLastModifiedTime = null)
 => PPBURLRequestInfo.AppendFileToBody(this,
                                       fileRef,
                                       startOffset,
                                       length,
                                       (utcExpectedLastModifiedTime.HasValue) ? PepperSharpUtils.ConvertToPepperTimestamp(utcExpectedLastModifiedTime.Value) : 0) == PPBool.True;