/**
  * Basic factory method to instantiate a new DirectorySync object with all the appropriate properties.
  *
  * @param string    $path      The local path
  * @param Container $container The container you're syncing
  * @param string    $targetDir The path (or pseudo-directory) that the files will be nested in
  *
  * @return DirectorySync
  */
 public static function factory($path, Container $container, $targetDir = null)
 {
     $transfer = new self();
     $transfer->setBasePath($path);
     $transfer->setContainer($container);
     $transfer->setRemoteFiles($container->objectList());
     $transfer->setTargetDir($targetDir);
     return $transfer;
 }