# File lib/mongrel/handlers.rb, line 122
122:     def can_serve(path_info)
123:       req_path = File.expand_path(File.join(@path,HttpRequest.unescape(path_info)), @path)
124: 
125:       if req_path.index(@path) == 0 and File.exist? req_path
126:         # it exists and it's in the right location
127:         if File.directory? req_path
128:           # the request is for a directory
129:           index = File.join(req_path, @index_html)
130:           if File.exist? index
131:             # serve the index
132:             return index
133:           elsif @listing_allowed
134:             # serve the directory
135:             return req_path
136:           else
137:             # do not serve anything
138:             return nil
139:           end
140:         else
141:           # it's a file and it's there
142:           return req_path
143:         end
144:       else
145:         # does not exist or isn't in the right spot
146:         return nil
147:       end
148:     end