The idea is something like this (self-referencing):
CREATE TABLE FileSystemObject (
ID int not null primary key identity,
Name varchar(100) not null,
ParentID int null references FileSystemObject(ID),
constraint uk_Path UNIQUE (Name, ParentID),
IsFolder bit not null
)