private static void AssertIsNotFile([NotNull] AbsolutePathComponent component, [NotNull] DirectoryEntry directory) { if (directory.Files.ContainsKey(component.Name)) { AbsolutePath pathUpToHere = component.GetPathUpToHere(); throw ErrorFactory.System.CannotCreateBecauseFileOrDirectoryAlreadyExists(pathUpToHere.GetText()); } }
private void AssertIsNotFile([NotNull] AbsolutePathComponent component, [NotNull] DirectoryEntry directory, [NotNull] string incomingPath) { if (directory.ContainsFile(component.Name)) { if (component.IsAtEnd) { throw ErrorLastDirectoryFoundAsFile(incomingPath); } throw ErrorDirectoryFoundAsFile(incomingPath); } }
private static string GetDirectoryName([NotNull] AbsolutePathComponent component) { return(component.IsAtStart && component.Path.IsOnLocalDrive ? component.Name.ToUpperInvariant() : component.Name); }