public static void DeleteAllData() { FileSystemDirectory folder = new FileSystemDirectory(SystemSession, "/", "", null); IEnumerable<string> files = folder.FileNames; foreach (string file in files) { FileSystemFile fileo = new FileSystemFile(SystemSession, "/", file, null); fileo.Delete(); } IEnumerable<string> folders = folder.SubDirectoryNames; foreach (string f in folders) { FileSystemDirectory fld = new FileSystemDirectory(SystemSession, "/", f, null); fld.Delete(); } }
protected internal override FileSystemStream DoGetFileStream(FileSystemFile file, Action<FileSystemStream> disposeAction) { return new DropBoxFileStream(file, disposeAction); }
/// <summary> /// Async version of <see cref="DoGetFileStream(FileSystemFile, Action{FileSystemStream})"/>. /// This base/default implementation just synchronously calls <see cref="DoGetFileStream(FileSystemFile, Action{FileSystemStream})"/> and /// returns already completed Task with result returned by <see cref="DoGetFileStream(FileSystemFile, Action{FileSystemStream})"/> /// </summary> protected internal virtual Task <FileSystemStream> DoGetFileStreamAsync(FileSystemFile file, Action <FileSystemStream> disposeAction) { return(TaskUtils.AsCompletedTask(() => DoGetFileStream(file, disposeAction))); }
private bool fileExists(FileSystemFile file) { var handle = (S3V4FSH)file.Handle; return S3V4.FileExists(handle.Path, S3_ACCESSKEY, S3_SECRETKEY, S3_BUCKET, S3_REGION, 0); }
/// <summary> /// Override to get file stream. /// This method may be called by miltiple threads /// </summary> protected internal abstract FileSystemStream DoGetFileStream(FileSystemFile file, Action <FileSystemStream> disposeAction);