예제 #1
0
 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();
     }
 }
예제 #2
0
 protected internal override FileSystemStream DoGetFileStream(FileSystemFile file, Action<FileSystemStream> disposeAction)
 {
     return new DropBoxFileStream(file, disposeAction);
 }
예제 #3
0
파일: FileSystem.cs 프로젝트: mjaric/nfx
 /// <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)));
 }
예제 #4
0
 private bool fileExists(FileSystemFile file)
 {
   var handle = (S3V4FSH)file.Handle;
   return S3V4.FileExists(handle.Path, S3_ACCESSKEY, S3_SECRETKEY, S3_BUCKET, S3_REGION, 0); 
 }
예제 #5
0
파일: FileSystem.cs 프로젝트: mjaric/nfx
 /// <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);