Lines Matching defs:File
3 // license that can be found in the LICENSE file.
5 // HTTP file system request handler
26 // A Dir implements FileSystem using the native file system restricted to a
30 // value is a filename on the native file system, not a URL, so it is separated
66 func (d Dir) Open(name string) (File, error) {
68 return nil, errors.New("http: invalid character in file path")
83 // The elements in a file path are separated by slash ('/', U+002F)
86 Open(name string) (File, error)
89 // A File is returned by a FileSystem's Open method and can be
92 // The methods should behave the same as those on an *os.File.
93 type File interface {
101 func dirList(w ResponseWriter, r *Request, f File) {
133 // first tries to deduce the type from name's file extension and,
150 // Note that *os.File implements the io.ReadSeeker interface.
178 // content must be seeked to the beginning of the file.
189 // If Content-Type isn't set, use the file's extension to find it, but
200 _, err := content.Seek(0, io.SeekStart) // rewind to output whole file
231 // is larger than the size of the file by
607 // Still a directory? (we didn't find an index.html file)
650 // file or directory.
652 // If the provided file or directory name is a relative path, it is
672 dir, file := filepath.Split(name)
673 serveFile(w, r, Dir(dir), file, false)
695 // with the contents of the file system rooted at root.
697 // To use the operating system's file system implementation,
702 // As a special case, the returned file server redirects any request
759 // range start relative to the end of the file.
782 // If no end is specified, range extends to end of the file.