Skip to content
This repository was archived by the owner on Nov 6, 2018. It is now read-only.
This repository was archived by the owner on Nov 6, 2018. It is now read-only.

Support GetFileInfo for directories #298

@stilettk

Description

@stilettk

Currently GetFileInfo supports only files: when called on a path that points to a directory it returns PhysicalFileInfo which has IsDirectory == false.

So, when given a path, how to decide what to do: to call GetFileInfo (if it's a file) or call GetDirectoryContents (if it's a folder)? Currently the only way I found isn't very intuitive:
bool isDirectory = fileProvider.GetDirectoryContents(myPath).Exists

My suggestion:
new PhysicalFileProvider(myPath).GetFileInfo("data")
Expected:
PhysicalDirectoryInfo
Actual:
PhysicalFileInfo

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions