public Method

HTTPUtils.load_mime_types(file)

Load Apache compatible mime.types file.

Source Code

# File webrick/httputils.rb, line 101
def load_mime_types(file)
  open(file){ |io|
    hash = Hash.new
    io.each{ |line|
      next if /^#/ =~ line
      line.chomp!
      mimetype, ext0 = line.split(/\s+/, 2)
      next unless ext0   
      next if ext0.empty?
      ext0.split(/\s+/).each{ |ext| hash[ext] = mimetype }
    }
    hash
  }
end
Comments

Have your say
Please use Textile formatting (click here for a cheat sheet). Use <code/> and <pre/> for code samples.
Click here to login with OpenID to to post comments.