Пример #1
0
        /// <summary>
        /// Initializes a new instance of the <see cref="TusDiskStore"/> class.
        /// </summary>
        /// <param name="directoryPath">The path on disk where to save files</param>
        /// <param name="deletePartialFilesOnConcat">True to delete partial files if a final concatenation is performed</param>
        /// <param name="bufferSize">The buffer size to use when reading and writing. If unsure use <see cref="TusDiskBufferSize.Default"/>.</param>
        public TusDiskStore(string directoryPath, bool deletePartialFilesOnConcat, TusDiskBufferSize bufferSize)
        {
            _directoryPath = directoryPath;
            _deletePartialFilesOnConcat = deletePartialFilesOnConcat;
            _fileRepFactory             = new InternalFileRep.FileRepFactory(_directoryPath);

            if (bufferSize == null)
            {
                bufferSize = TusDiskBufferSize.Default;
            }

            _maxWriteBufferSize = bufferSize.WriteBufferSizeInBytes;
            _maxReadBufferSize  = bufferSize.ReadBufferSizeInBytes;
        }
Пример #2
0
 /// <summary>
 /// Initializes a new instance of the <see cref="TusDiskStore"/> class.
 /// </summary>
 /// <param name="directoryPath">The path on disk where to save files</param>
 /// <param name="deletePartialFilesOnConcat">True to delete partial files if a final concatenation is performed</param>
 /// <param name="bufferSize">The buffer size to use when reading and writing. If unsure use <see cref="TusDiskBufferSize.Default"/>.</param>
 public TusDiskStore(string directoryPath, bool deletePartialFilesOnConcat, TusDiskBufferSize bufferSize) : this(directoryPath, deletePartialFilesOnConcat, bufferSize, DefaultFileIdProvider)
 {
     // Left blank.
 }