code: protected static function isFileSyncExclude($strPath)
  	{
  		if (Config::get('uploadPath') == 'templates')
  		{
  			return true;
  		}
  
  		$rootDir = System::getContainer()->getParameter('kernel.project_dir');
  
  		// Look for an existing parent folder (see #410)
  		while ($strPath != '.' && !is_dir($rootDir . '/' . $strPath))
  		{
  			$strPath = \dirname($strPath);
  		}
  
  		if ($strPath == '.')
  		{
  			return true;
  		}
  
  		$uploadPath = System::getContainer()->getParameter('contao.upload_path');
  
  		// Outside the files directory
  		if (strncmp($strPath . '/', $uploadPath . '/', \strlen($uploadPath) + 1) !== 0)
  		{
  			return true;
  		}
  
  		return (new Folder($strPath))->isUnsynchronized();
  	}
docs: Check if a file or folder is excluded from synchronization
  
  @param string $strPath The relative path
  
  @return bool True if the file or folder is excluded from synchronization