Example #1
0
 internal D7FileDownloader(string targetDir, string subUrlPattern, IFileSystemShim fsShim, ID7Client d7Client)
 {
     _client     = ForwardLogs(d7Client);
     _fs         = ForwardLogs(fsShim);
     _foldr      = _fs.Folder(targetDir);
     _urlPattern = subUrlPattern;
     _suffix     = "_" + DateTime.Now.TimeOfDay.TotalMinutes;
     DeleteOldReplacements();
 }
Example #2
0
 internal D7FileDownloader(string targetDir, string subUrlPattern, IFileSystemShim fsShim, ID7Client d7Client)
 {
     _client     = ForwardLogs(d7Client);
     _fs         = ForwardLogs(fsShim);
     _foldr      = _fs.Folder(targetDir);
     _urlPattern = subUrlPattern;
     _suffix     = "_" + DateTime.Now.TimeOfDay.TotalMinutes;
     DeleteOldReplacements();
 }
Example #3
0
        private FolderShim DefineCacheFolder(ISessionClient client,
                                             IBasicAuthenticationKey authKey)
        {
            //Throw.IfNull(_fs, "private FileSystemShim");
            //if (_fs == null) return null;

            if (authKey.BaseUrl.IsBlank() || authKey.UserName.IsBlank())
            {
                Warn_n("Unable to define cache folder.",
                       "User name or base URL should not be blank.");
                return(null);
            }


            var loc  = _fs.GetSpecialDir(SpecialDir.LocalApplicationData);
            var typ  = client.GetType().Name;
            var dom  = authKey.BaseUrl.TextAfter("//").Replace(":", "-");
            var usr  = authKey.UserName;//.Replace(" ", "_");
            var end  = "CachedNodes";
            var path = loc.Bslash(typ).Bslash(dom).Bslash(usr).Bslash(end);

            return(_fs.Folder(path));
        }
Example #4
0
 public FolderShim SubFolder(string subFolderName)
 {
     return(_fs.Folder(Append(subFolderName)));
 }