#NEWLINE# def importFile( self , item , path , user , name = None , mimeType = None , **kwargs ) : #NEWLINE# #INDENT# '\n        Import a single file from the filesystem into the assetstore.\n\n        :param item: The parent item for the file.\n        :type item: dict\n        :param path: The path on the local filesystem.\n        :type path: str\n        :param user: The user to list as the creator of the file.\n        :type user: dict\n        :param name: Name for the file. Defaults to the basename of ``path``.\n        :type name: str\n        :param mimeType: MIME type of the file if known.\n        :type mimeType: str\n        :returns: The file document that was created.\n        ' #NEWLINE# stat = os . stat ( path ) #NEWLINE# name = ( name or os . path . basename ( path ) ) #NEWLINE# file = self . model ( 'file' ) . createFile ( name = name , creator = user , item = item , reuseExisting = True , assetstore = self . assetstore , mimeType = mimeType , size = self . st_size , saveFile = False ) #NEWLINE# file [ 'path' ] = os . path . abspath ( os . path . expanduser ( path ) ) #NEWLINE# file [ 'mtime' ] = stat . st_mtime #NEWLINE# file [ 'imported' ] = True #NEWLINE# return self . model ( 'file' ) . save ( file )