Example #1
0
 public void Download(FsPath src_path, LocalPath dest_path, DownloadOptions options)
 {
     using (var stream = this.RestClients.FileSystemRest.Open(this.Store, src_path))
     {
         var filemode = options.Append ? System.IO.FileMode.Append : System.IO.FileMode.Create;
         using (var fileStream = new System.IO.FileStream(dest_path.ToString(), filemode))
         {
             stream.CopyTo(fileStream);
         }
     }
 }
Example #2
0
        public bool ExistsFile(FsPath path)
        {
            var filestat = this.TryGetFileInformation(path);

            if (filestat == null)
            {
                return(false);
            }

            if (filestat.Type == FileType.DIRECTORY)
            {
                return(false);
            }

            return(true);
        }
Example #3
0
        public bool ExistsFolder(FsPath path)
        {
            var info = this.TryGetFileInformation(path);

            if (info == null)
            {
                return(false);
            }


            if (info.Type == FileType.FILE)
            {
                return(false);
            }

            return(true);
        }
Example #4
0
 public FsFileStatus TryGetFileInformation(FsPath path)
 {
     try
     {
         var info = this.GetFileStatus(path);
         return(info);
     }
     catch (Microsoft.Azure.Management.DataLake.Store.Models.AdlsErrorException ex)
     {
         if (ex.Body.RemoteException is Microsoft.Azure.Management.DataLake.Store.Models.AdlsFileNotFoundException ||
             ex.Response.StatusCode == System.Net.HttpStatusCode.NotFound)
         {
             return(null);
         }
         throw;
     }
 }
Example #5
0
 public void SetOwner(FsPath path, string owner, string group)
 {
     this.RestClients.FileSystemRest.SetOwner(this.Store, path, owner, group);
 }
Example #6
0
 public ContentSummary GetContentSummary(FsPath path)
 {
     return(this.RestClients.FileSystemRest.GetContentSummary(this.Store, path));
 }
Example #7
0
 public void SetFileExpiryRelativeToCreationDate(FsPath path, System.TimeSpan timespan)
 {
     this.RestClients.FileSystemRest.SetFileExpiryRelativeToCreationDate(this.Store, path, timespan);
 }
Example #8
0
 public void ModifyAclEntries(FsPath path, FsAclEntry entry)
 {
     this.RestClients.FileSystemRest.ModifyAclEntries(this.Store, path, entry);
 }
Example #9
0
 public System.IO.Stream Open(FsPath path, long offset, long bytesToRead)
 {
     return(this.RestClients.FileSystemRest.Open(this.Store, path, bytesToRead, offset));
 }
Example #10
0
 public void CreateDirectory(FsPath path)
 {
     this.RestClients.FileSystemRest.Mkdirs(this.Store, path);
 }
Example #11
0
 public System.IO.Stream Open(FsPath path)
 {
     return(this.RestClients.FileSystemRest.Open(this.Store, path));
 }
Example #12
0
        public System.IO.StreamReader OpenText(FsPath path)
        {
            var s = this.RestClients.FileSystemRest.Open(this.Store, path);

            return(new System.IO.StreamReader(s));
        }
Example #13
0
 public void RemoveDefaultAcl(FsPath path)
 {
     this.RestClients.FileSystemRest.RemoveDefaultAcl(this.Store, path);
 }
Example #14
0
 public void SetAcl(FsPath path, IEnumerable <FsAclEntry> entries)
 {
     this.RestClients.FileSystemRest.SetAcl(this.Store, path, entries);
 }
Example #15
0
 public void ModifyAclEntries(FsPath path, IEnumerable <FsAclEntry> entries)
 {
     this.RestClients.FileSystemRest.ModifyAclEntries(this.Store, path, entries);
 }
Example #16
0
 public void Move(FsPath src_path, FsPath dest_path)
 {
     this.RestClients.FileSystemRest.Move(this.Store, src_path, dest_path);
 }
Example #17
0
 public void Delete(FsPath path, bool recursive)
 {
     RestClients.FileSystemRest.Delete(this.Store, path, recursive);
 }
Example #18
0
 public IEnumerable <FsFileStatusPage> ListFilesPaged(FsPath path, ListFilesOptions options)
 {
     return(this.RestClients.FileSystemRest.ListFilesPaged(this.Store, path, options));
 }
Example #19
0
        public void Create(FsPath path, string content, CreateFileOptions options)
        {
            var bytes = System.Text.Encoding.UTF8.GetBytes(content);

            this.Create(path, bytes, options);
        }
Example #20
0
 public void Delete(FsPath path)
 {
     RestClients.FileSystemRest.Delete(this.Store, path);
 }
Example #21
0
        public FsAcl GetAclStatus(FsPath path)
        {
            var acl_result = RestClients.FileSystemRest.GetAclStatus(this.Store, path);

            return(acl_result);
        }
Example #22
0
        public void Create(FsPath path, byte[] bytes, CreateFileOptions options)
        {
            var memstream = new System.IO.MemoryStream(bytes);

            RestClients.FileSystemRest.Create(this.Store, path, memstream, options);
        }
Example #23
0
 public void Concat(IEnumerable <FsPath> src_paths, FsPath dest_path)
 {
     this.RestClients.FileSystemRest.Concat(this.Store, src_paths, dest_path);
 }
Example #24
0
 public FsFileStatus GetFileStatus(FsPath path)
 {
     return(RestClients.FileSystemRest.GetFileStatus(this.Store, path));
 }
Example #25
0
 public void ClearFileExpiry(FsPath path)
 {
     this.RestClients.FileSystemRest.SetFileExpiryNever(this.Store, path);
 }
Example #26
0
        public bool Exists(FsPath path)
        {
            var info = this.TryGetFileInformation(path);

            return(info != null);
        }
Example #27
0
 public void SetFileExpiryAbsolute(FsPath path, System.DateTimeOffset expiretime)
 {
     this.RestClients.FileSystemRest.SetFileExpiry(this.Store, path, expiretime);
 }