Ejemplo n.º 1
0
        public DirectoryEntry TryResolveDirectory([NotNull] AbsolutePath path, [CanBeNull] string incomingPath = null)
        {
            Guard.NotNull(path, nameof(path));

            string completePath = incomingPath ?? path.GetText();

            AssertNetworkShareExists(path, completePath);

            if (!container.ContainsVolume(path.VolumeName))
            {
                return(null);
            }

            DirectoryEntry directory = container.GetVolume(path.VolumeName);

            foreach (AbsolutePathComponent component in path.EnumerateComponents().Skip(1))
            {
                AssertIsNotFile(component, directory, completePath);

                if (!directory.ContainsDirectory(component.Name))
                {
                    return(null);
                }

                directory = directory.GetDirectory(component.Name);
            }

            return(directory);
        }
Ejemplo n.º 2
0
        public FakeFileSystem Build()
        {
            if (includeDriveC && !container.ContainsVolume("C:"))
            {
                IncludingVolume("C:", DefaultVolumeInfo);
            }

            string effectiveTempDirectory = CreateTempDirectory();

            copyWaitIndicator.Reset();
            return(new FakeFileSystem(container, effectiveTempDirectory, copyWaitIndicator));
        }