Ejemplo n.º 1
0
 def get(self, group, path):
     logging.info("Request for %s file %s" % (group, path))
     
     #check that requested file directory is in defined archives - note that group does not have the leading \ or / characters
     if os.path.normpath(group).startswith(self.portal_rel_path):
         self.root = self.portal_abs_path + os.path.sep
         group = relativePath(group[len(self.portal_rel_path):])
     elif os.path.normpath(group).startswith(self.report_rel_path):
         self.root = self.report_abs_path + os.path.sep
         group = relativePath(group[len(self.report_rel_path):])
     else:
         raise HTTPError(404, "Invalid file %s" % path)
     
     path = os.path.join(group, path)
     #disable caching or archive files
     self.set_header("Cache-control", "no-cache")        
     StaticFileHandler.get(self, path, include_body=True)
Ejemplo n.º 2
0
 def initialize(self, portal_archive_path, report_archive_path):
     self.default_filename = None
     self.portal_abs_path = portal_archive_path
     self.report_abs_path = report_archive_path
     self.portal_rel_path = relativePath(portal_archive_path)
     self.report_rel_path = relativePath(report_archive_path)