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));
        }
    }
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));
        }
    }
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 ) ) ; } }
Copies files or folders to the Artifact location.

@param Transformation $transformation Transformation to use as data source.

@throws Exception

@return void
Copies files or folders to the Artifact location .