Example #1
0
    def _threadDoGETJob(self, request):

        hash = request.hydrus_args['hash']

        # don't I need to check that we aren't stealing the file from another service?

        path = ServerFiles.GetFilePath(hash)

        response_context = HydrusServerResources.ResponseContext(200,
                                                                 path=path)

        return response_context
Example #2
0
 def _threadDoGETJob( self, request ):
     
     self._checkBandwidth( request )
     
     # no permissions check as any functional account can get updates
     
     update_hash = request.hydrus_args[ 'update_hash' ]
     
     if not self._service.HasUpdateHash( update_hash ):
         
         raise HydrusExceptions.NotFoundException( 'This update hash does not exist on this service!' )
         
     
     path = ServerFiles.GetFilePath( update_hash )
     
     response_context = HydrusServerResources.ResponseContext( 200, mime = HC.APPLICATION_OCTET_STREAM, path = path )
     
     return response_context
Example #3
0
 def _threadDoGETJob( self, request ):
     
     self._checkBandwidth( request )
     
     # no permission check as any functional account can get files
     
     hash = request.hydrus_args[ 'hash' ]
     
     ( valid, mime ) = HG.server_controller.Read( 'service_has_file', self._service_key, hash )
     
     if not valid:
         
         raise HydrusExceptions.NotFoundException( 'File not found on this service!' )
         
     
     path = ServerFiles.GetFilePath( hash )
     
     response_context = HydrusServerResources.ResponseContext( 200, mime = mime, path = path )
     
     return response_context