Example #1
0
 protected static bool IsStaticResource(object sender)
 {
     var application = sender as HttpApplication;
     if (application != null)
     {
         IWebHelper webHelper = new WebHelper();
         return webHelper.IsStaticResource(application.Request);
     }
     return false;
 }
        public void Init() {
            _folderPath = Path.Combine(Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "Media"), "Default");
            _filePath = _folderPath + "\\testfile.txt";

            Directory.CreateDirectory(_folderPath);
            File.WriteAllText(_filePath, "testfile contents");

            var subfolder1 = Path.Combine(_folderPath, "Subfolder1");
            Directory.CreateDirectory(subfolder1);
            File.WriteAllText(Path.Combine(subfolder1, "one.txt"), "one contents");
            File.WriteAllText(Path.Combine(subfolder1, "two.txt"), "two contents");

            var subsubfolder1 = Path.Combine(subfolder1, "SubSubfolder1");
            Directory.CreateDirectory(subsubfolder1);

            var context = new FakeHttpContext("~/");
            var webHelper = new WebHelper(context);

            _storageProvider = new FileSystemStorageProvider(new FileSystemSettings { DirectoryName = "Default" }, webHelper);
        }