Modify directory construction
Support file protocol