original_string: public function executeQueryCopy(Transformation $transformation)
      {
          $path = $transformation->getSourceAsPath();
  
          if (!is_readable($path)) {
              throw new Exception('Unable to read the source file: ' . $path);
          }
          if (!is_writable($transformation->getTransformer()->getTarget())) {
              throw new Exception('Unable to write to: ' . dirname($transformation->getArtifact()));
          }
  
          $filesystem = new Filesystem();
          if (is_file($path)) {
              $filesystem->copy($path, $transformation->getArtifact(), true);
          } else {
              $filesystem->mirror($path, $transformation->getArtifact(), null, array('override' => true));
          }
      }
code: public function executeQueryCopy(Transformation $transformation)
      {
          $path = $transformation->getSourceAsPath();
  
          if (!is_readable($path)) {
              throw new Exception('Unable to read the source file: ' . $path);
          }
          if (!is_writable($transformation->getTransformer()->getTarget())) {
              throw new Exception('Unable to write to: ' . dirname($transformation->getArtifact()));
          }
  
          $filesystem = new Filesystem();
          if (is_file($path)) {
              $filesystem->copy($path, $transformation->getArtifact(), true);
          } else {
              $filesystem->mirror($path, $transformation->getArtifact(), null, array('override' => true));
          }
      }
code_tokens: public function executeQueryCopy ( Transformation $ transformation ) { $ path = $ transformation -> getSourceAsPath ( ) ; if ( ! is_readable ( $ path ) ) { throw new Exception ( 'Unable to read the source file: ' . $ path ) ; } if ( ! is_writable ( $ transformation -> getTransformer ( ) -> getTarget ( ) ) ) { throw new Exception ( 'Unable to write to: ' . dirname ( $ transformation -> getArtifact ( ) ) ) ; } $ filesystem = new Filesystem ( ) ; if ( is_file ( $ path ) ) { $ filesystem -> copy ( $ path , $ transformation -> getArtifact ( ) , true ) ; } else { $ filesystem -> mirror ( $ path , $ transformation -> getArtifact ( ) , null , array ( 'override' => true ) ) ; } }
docstring: Copies files or folders to the Artifact location.
  
  @param Transformation $transformation Transformation to use as data source.
  
  @throws Exception
  
  @return void
docstring_tokens: Copies files or folders to the Artifact location .