func (f *File) Open(u *url.URL) (*resource.Resource, error) {
	name := u.Path
	m, err := filepath.Glob(name)
	if err != nil {
		return nil, err
	}
	if len(m) == 1 {
		return f.openOne(name)
	}
	return f.openMulti(m, name)
}
Open opens a URL as file.
package protocol
import (
	"bytes"
	"compress/bzip2"
	"compress/gzip"
	"fmt"
	"io"
	"io/ioutil"
	"log"
	"net/url"
	"os"
	"path/filepath"
	"regexp"
	"strconv"
	"strings"
	"time"
	"github.com/koron/nvgd/common_const"
	"github.com/koron/nvgd/config"
	"github.com/koron/nvgd/ltsv"
	"github.com/koron/nvgd/resource"
	"github.com/pierrec/lz4"
)
type File struct {
}
type FileConfig struct {
	Locations []string `yaml:"locations"`
	Forbiddens []string `yaml:"forbiddens"`
}
func match(path string, paths []string, defaultValue bool) bool {
	if len(paths) == 0 {
		return defaultValue
	}
	for _, s := range paths {
		if strings.HasPrefix(path, s) {
			return true
		}
	}
	return false
}
func (fc FileConfig) isAccessible(path string) bool {
	return match(path, fc.Locations, true) &&
		!match(path, fc.Forbiddens, false)
}
var fc FileConfig
func init() {
	MustRegister("file", &File{})
	config.RegisterProtocol("file", &fc)
}