var encodeLocalPath = function(path) {
        var segments = path.split('/');
        var result = [];
        segments.forEach(function(segment){
            result.push(encodeURIComponent(segment));