public FileUploader(Connection connection, Endpoint p, ISendSafelyProgress progress) { this.p = p; this.progress = progress; this.connection = connection; this.boundary = DateTime.Now.Ticks.ToString(); }
public DownloadFileUtility(Connection connection, Directory directory, PackageInformation pkgInfo, ISendSafelyProgress progress, string downloadApi) { _pkgInfo = pkgInfo; _progress = progress; _connection = connection; _downloadApi = downloadApi; _directoryInfo = directory; }
public DownloadFileUtility(Connection connection, PackageInformation pkgInfo, ISendSafelyProgress progress, string downloadApi, string password) { _pkgInfo = pkgInfo; _progress = progress; _connection = connection; _downloadApi = downloadApi; _password = password; }
public DownloadFileUtility(Connection connection, Directory directory, PackageInformation pkgInfo, ISendSafelyProgress progress, String downloadAPI) { this.pkgInfo = pkgInfo; this.progress = progress; this.connection = connection; this.downloadAPI = downloadAPI; this.directoryInfo = directory; }
public DownloadFileUtility(Connection connection, PackageInformation pkgInfo, ISendSafelyProgress progress, String downloadAPI, String password) { this.pkgInfo = pkgInfo; this.progress = progress; this.connection = connection; this.downloadAPI = downloadAPI; this.password = password; }
public ProgressStream(Stream inner, ISendSafelyProgress progress, string prefix, long size, long offset) { _inner = inner; _progress = progress; _prefix = prefix; _fileSize = size; _readSoFar = 0; _offset = offset; _stopwatch = new Stopwatch(); _stopwatch.Start(); }
public ProgressStream(Stream inner, ISendSafelyProgress progress, String prefix, long size, long offset) { this._inner = inner; this._progress = progress; this._prefix = prefix; this._fileSize = size < 1024 ? size * 1024 : size; // multiple file size by 1024 if fileSize is less than 1024 bytes. this._readSoFar = 0; this._offset = offset; _lastProgressCallback = DateTime.Now.Ticks - UPDATE_FREQUENCY; // Make sure we trigger it the first time. _stopwatch = new Stopwatch(); _stopwatch.Start(); }
public void EncryptFile(FileInfo encryptedFile, FileInfo inputFile, String filename, char[] passPhrase, ISendSafelyProgress progress) { using (FileStream outStream = encryptedFile.OpenWrite()) { PgpEncryptedDataGenerator cPk = new PgpEncryptedDataGenerator(SymmetricKeyAlgorithmTag.Aes256, true); cPk.AddMethod(passPhrase); using (Stream cOut = cPk.Open(outStream, new byte[1 << 16])) { WriteFileToLiteralData(cOut, PgpLiteralData.Binary, inputFile, filename, inputFile.Length); } } }