Exemplo n.º 1
0
 public IVirtualDirectory GetDirectory(string virtualPath, bool forceDir)
 {
     var dirPath = SanitizePath(virtualPath);
     if (string.IsNullOrEmpty(dirPath))
         return rootDirectory;
     
     var dir = new InMemoryVirtualDirectory(this, dirPath, GetParentDirectory(dirPath));
     return forceDir || dir.HasFiles()
         ? dir
         : null;
 }
Exemplo n.º 2
0
        public IVirtualDirectory GetDirectory(string virtualPath, bool forceDir)
        {
            var dirPath = SanitizePath(virtualPath);

            if (string.IsNullOrEmpty(dirPath))
            {
                return(rootDirectory);
            }

            var dir = new InMemoryVirtualDirectory(this, dirPath, GetParentDirectory(dirPath));

            return(forceDir || dir.Files.Any()
                ? dir
                : null);
        }