note description: "Summary description for {CMS_FILE_UPLOAD_FILE_SYSTEM_HANDLER}." author: "" date: "$Date$" revision: "$Revision$" class CMS_FILE_UPLOAD_FILE_SYSTEM_HANDLER inherit WSF_FILE_SYSTEM_HANDLER redefine process_index end create make_with_p feature -- Initialization make_with_p (d: like document_root) do if d.is_empty then document_root := execution_environment.current_working_path else document_root := d end ensure not document_root.is_empty end feature -- process function process_index (a_uri: READABLE_STRING_8; dn: PATH; req: WSF_REQUEST; res: WSF_RESPONSE) local h: HTTP_HEADER uri, s: STRING_8 d: DIRECTORY l_files: LIST [PATH] p: PATH n: READABLE_STRING_32 httpdate: HTTP_DATE pf: RAW_FILE l_is_dir: BOOLEAN do create d.make_with_path (dn) d.open_read if attached directory_index_file (d) as f then process_file (f, req, res) else uri := a_uri if not uri.is_empty and then uri [uri.count] /= '/' then uri.append_character ('/') end s := "[
| Name | Last modified | Size | |
|---|---|---|---|
| ") if l_is_dir then s.append ("[dir]") else s.append (" ") end s.append (" | ") s.append ("") if p.is_parent_symbol then s.append ("[Parent Directory] ..") else s.append (html_encoder.encoded_string (n)) end if l_is_dir then s.append ("/") end s.append (" | ") s.append ("") if pf.exists then create httpdate.make_from_date_time (file_date (pf)) httpdate.append_to_rfc1123_string (s) end s.append (" | ") s.append ("") if not l_is_dir and pf.exists then s.append_integer (file_size (pf)) end s.append (" | ") s.append ("