'Make a L{static.File} resource that has C{content} for its content.
@param content: The L{bytes} to use as the contents of the resource.
@param type: Optional value for the content type of the resource.'

def makeResourceWithContent(self, content, type=None, encoding=None):

    fileName = FilePath(self.mktemp())
    fileName.setContent(content)
    resource = static.File(fileName._asBytesPath())
    resource.encoding = encoding
    resource.type = type
    return resource
