parameters: (self)
return_statement: return
docstring: Create copy of files/directories
docstring_summary: Create copy of files/directories
docstring_tokens: Create copy of files / directories
function: def __duplicate(self):
  		"""Create copy of files/directories"""
  		if 'current' in self._request and 'target' in self._request:
  			curDir = self.__findDir(self._request['current'], None)
  			target = self.__find(self._request['target'], curDir)
  			if not curDir or not target:
  				self._response['error'] = 'Invalid parameters'
  				return
  			if not self.__isAllowed(target, 'read') or not self.__isAllowed(curDir, 'write'):
  				self._response['error'] = 'Access denied'
  			newName = self.__uniqueName(target)
  			if not self.__copy(target, newName):
  				self._response['error'] = 'Unable to create file copy'
  				return
  
  		self.__content(curDir, True)
  		return
function_tokens: def __duplicate ( self ) : if 'current' in self . _request and 'target' in self . _request : curDir = self . __findDir ( self . _request [ 'current' ] , None ) target = self . __find ( self . _request [ 'target' ] , curDir ) if not curDir or not target : self . _response [ 'error' ] = 'Invalid parameters' return if not self . __isAllowed ( target , 'read' ) or not self . __isAllowed ( curDir , 'write' ) : self . _response [ 'error' ] = 'Access denied' newName = self . __uniqueName ( target ) if not self . __copy ( target , newName ) : self . _response [ 'error' ] = 'Unable to create file copy' return self . __content ( curDir , True ) return