public void Parent_Folder_Of_Root_Should_Be_Null()
        {
            root = provider.GetFileSystemRoot();
            Assert.IsNull(root.ParentFolderPath);

            root = provider.GetFolderInfo(root.FullName);
            Assert.IsNull(root.ParentFolderPath);
        }
    public void Custom_Root_Name_Should_Be_Returned_If_Set()
    {
      provider = new LocalFileSystemProvider("FOO");
      root = provider.GetFileSystemRoot();

      Assert.AreEqual("FOO", root.Name);
    }
        public void Custom_Root_Name_Should_Be_Returned_If_Set()
        {
            provider = new LocalFileSystemProvider("FOO");
            root     = provider.GetFileSystemRoot();

            Assert.AreEqual("FOO", root.Name);
        }
    public void Init()
    {
      rootDirectory = TestUtil.CreateTestDirectory();

      //init provider
      DownloadTransferStore = new TestTransferStore<LocalDownloadTransfer>();
      UploadTransferStore = new TestTransferStore<LocalUploadTransfer>();

      var configuration = LocalFileSystemConfiguration.CreateForRootDirectory(rootDirectory, true);
      configuration.DownloadStore = DownloadTransferStore;
      configuration.UploadStore = UploadTransferStore;
      configuration.DownloadTokenExpirationTime = TimeSpan.FromHours(24);
      configuration.UploadTokenExpirationTime = TimeSpan.FromHours(24);
      configuration.DefaultDownloadBlockSize = 32768;
      configuration.MaxDownloadBlockSize = 32768 * 2;
      configuration.MaxUploadBlockSize = 32768 * 4;

      AdjustFileSystemConfiguration(configuration);
      FileSystemConfiguration = configuration;

      provider = new LocalFileSystemProvider(FileSystemConfiguration);
      root = provider.GetFileSystemRoot();

      InitInternal();
    }
        public void Init()
        {
            rootDirectory = TestUtil.CreateTestDirectory();

            //init provider
            DownloadTransferStore = new TestTransferStore <LocalDownloadTransfer>();
            UploadTransferStore   = new TestTransferStore <LocalUploadTransfer>();

            var configuration = LocalFileSystemConfiguration.CreateForRootDirectory(rootDirectory, true);

            configuration.DownloadStore = DownloadTransferStore;
            configuration.UploadStore   = UploadTransferStore;
            configuration.DownloadTokenExpirationTime = TimeSpan.FromHours(24);
            configuration.UploadTokenExpirationTime   = TimeSpan.FromHours(24);
            configuration.DefaultDownloadBlockSize    = 32768;
            configuration.MaxDownloadBlockSize        = 32768 * 2;
            configuration.MaxUploadBlockSize          = 32768 * 4;

            AdjustFileSystemConfiguration(configuration);
            FileSystemConfiguration = configuration;

            provider = new LocalFileSystemProvider(FileSystemConfiguration);
            root     = provider.GetFileSystemRoot();

            InitInternal();
        }
示例#6
0
        /// <summary>
        /// Creates a <see cref="VirtualFolder"/> instance that represents
        /// the root folder of a given file system.
        /// </summary>
        /// <param name="fileSystem">The file system to be used.</param>
        /// <returns>The root folder of the submitted <paramref name="fileSystem"/>,
        /// as returned by <see cref="IFileSystemProvider.GetFileSystemRoot"/>.</returns>
        /// <exception cref="ArgumentNullException">If <paramref name="fileSystem"/>
        /// is a null reference.</exception>
        public static VirtualFolder CreateRootFolder(IFileSystemProvider fileSystem)
        {
            if (fileSystem == null)
            {
                throw new ArgumentNullException("fileSystem");
            }

            var rootInfo = fileSystem.GetFileSystemRoot();

            return(new VirtualFolder(fileSystem, rootInfo));
        }
 public void Init()
 {
   provider = new LocalFileSystemProvider();
   root = provider.GetFileSystemRoot();
 }
 public void Init()
 {
     provider = new LocalFileSystemProvider();
     root     = provider.GetFileSystemRoot();
 }