Copies all files from the source location to the target location.
778175
protected function copyFiles()
    {
        $skeletonFinder = new SkeletonFinder($this->lookupPaths);
        $sourcePath = $skeletonFinder->findByName($this->skeletonName)->getRealpath();

        $finder = $this->getFinderForFilesToCopy($sourcePath);

        foreach ($finder as $file) {
            $targetFilePath = $this->targetPath.DIRECTORY_SEPARATOR.$file->getRelativePathname();
            $targetFilePath = $this->twigStringRenderer->renderToString($targetFilePath, $this->data);

            $this->fs->copy($file->getRealpath(), $targetFilePath, $this->overwriteEnabled);

            $msg = '[copy] '.$file->getRealpath().' => '.$targetFilePath;

            if ($this->reportingEnabled) {
                $this->report[] = $msg;
            }
        }
    }
342594
public static void copy(File sourceFile, File targetFile) throws IOException {
	FileInputStream in = new FileInputStream(sourceFile);
	try {
	    FileOutputStream out = new FileOutputStream(targetFile);
	    try {
		copy(in, out);
	    } finally {
		out.close();
	    }
	} finally {
	    in.close();
	}
    }
744968
public static void copyResourceFile(String source, Path target) throws IOException {
        InputStream resource = FsCrawlerUtil.class.getResourceAsStream(source);
        FileUtils.copyInputStreamToFile(resource, target.toFile());
    }
237544
def copy(options)
      destination = copy_destination options
      to_path = join_paths @root_dir, destination
      to_path_exists = File.exist? to_path

      preserve_existing = false? options[:overwrite]

      copy_resource_to_path to_path, preserve_existing
      copy_pstore_to_path to_path, preserve_existing

      to_path_exists
    end
1040524
public static void copyDirectory(File source, File target) {
        if (source.isDirectory()) {
            if (!target.exists()) {
                target.mkdir();
            }
            for (String child : source.list()) {
                copyDirectory(new File(source, child), new File(target, child));
            }
        } else {
            try {
                write(new FileInputStream(source), new FileOutputStream(target));
            } catch (IOException e) {
                if (target.isDirectory()) {
                    if (!target.exists()) {
                        if (!target.mkdirs()) {
                            throw E.ioException("cannot copy [%s] to [%s]", source, target);
                        }
                    }
                    target = new File(target, source.getName());
                } else {
                    File targetFolder = target.getParentFile();
                    if (!targetFolder.exists()) {
                        if (!targetFolder.mkdirs()) {
                            throw E.ioException("cannot copy [%s] to [%s]", source, target);
                        }
                    }
                }
                try {
                    write(new FileInputStream(source), new FileOutputStream(target));
                } catch (IOException e0) {
                    throw E.ioException(e0);
                }
            }
        }
    }
973458
public static <T> void copy(final T source, final T target) {

    if (isEmpty(source) || isEmpty(target)) {
      return;
    }
    int sourceLength = Array.getLength(source);
    int targetLength = Array.getLength(target);
    int minLenght = Math.min(sourceLength, targetLength);
    copy(source, target, 0, 0, minLenght);
  }
312156
private boolean copy(InputStream source, String destination) {
        boolean success = true;

        try
        {
            Files.copy(source, Paths.get(destination), StandardCopyOption.REPLACE_EXISTING);
        } catch (IOException ex)
        {
            LOG.fatal("Cannot write file " + destination, ex);
            success = false;
        }

        return success;
    }
348437
public static void copy(File source, File target) throws IOException {
        if (!source.exists()) {
            throw new FileNotFoundException("Source file not found:" + source.getAbsolutePath());
        }

        if (!target.exists() && !target.getParentFile().exists() && !target.getParentFile().mkdirs()) {
            throw new IOException("Can't create target directory:" + target.getParentFile().getAbsolutePath());
        }
        if (source.isDirectory()) {
            target.mkdirs();
            File[] files = source.listFiles();
            if (files != null) {
                for (File child : files) {
                    copy(child, new File(target, child.getName()));
                }
            }
        } else {
            FileInputStream is = new FileInputStream(source);
            FileOutputStream os = new FileOutputStream(target);
            io.fabric8.utils.Files.copy(is, os);
        }
    }
1083396
void copyTo(final File destinationFolder) throws IOException {
    for (final File f : this.theFiles) {
      final File destinationFile = new File(destinationFolder, f.getName());
      Files.copy(f.toPath(), destinationFile.toPath(), java.nio.file.StandardCopyOption.REPLACE_EXISTING);
    }
  }
722252
def copy(location):
	""""""
	copyData = settings.getDataFile()
	copyFileLocation = os.path.abspath(location)
	copy = {"copyLocation": copyFileLocation}
	dataFile = open(copyData, "wb")
	pickle.dump(copy, dataFile)
	speech.speak(location + " copied successfully!")
	speech.speak("Tip: use 'hallie paste' to paste this file.")
382960
public static void copy(InputStream source, File destination) throws IOException {
        OutputStream output = null;

        try {
            output = new FileOutputStream(destination);
            copy(source, output);
        } finally {
            closeQuietly(output);
        }
    }
1181720
def copytree_and_gzip(self, source_dir, target_dir):
        
        # Figure out what we're building...
        build_list = []
        # Walk through the source directory...
        for (dirpath, dirnames, filenames) in os.walk(source_dir):
            for f in filenames:
                # Figure out what is going where
                source_path = os.path.join(dirpath, f)
                rel_path = os.path.relpath(dirpath, source_dir)
                target_path = os.path.join(target_dir, rel_path, f)
                # Add it to our list to build
                build_list.append((source_path, target_path))

        logger.debug("Gzipping {} files".format(len(build_list)))

        # Build em all
        if not getattr(self, 'pooling', False):
            [self.copyfile_and_gzip(*u) for u in build_list]
        else:
            cpu_count = multiprocessing.cpu_count()
            logger.debug("Pooling build on {} CPUs".format(cpu_count))
            pool = ThreadPool(processes=cpu_count)
            pool.map(self.pooled_copyfile_and_gzip, build_list)
399425
public static void copyRecursively(Path source, Path destination) throws IOException {
        if (Files.isDirectory(source))
        {
            Files.createDirectories(destination);
            final Set<Path> sources = listFiles(source);

            for (Path srcFile : sources)
            {
                Path destFile = destination.resolve(srcFile.getFileName());
                copyRecursively(srcFile, destFile);
            }
        }
        else
        {
            Files.copy(source, destination, StandardCopyOption.COPY_ATTRIBUTES, StandardCopyOption.REPLACE_EXISTING);
        }
    }
511500
private function copyAllWebsiteFiles()
    {
        // routes

        // VIEWS
        $source = "{$this->basePath}resources{$this->ds}views{$this->ds}website";
        $destination = resource_path("views{$this->ds}website");
        $this->copyFilesFromSource($source, $destination);

        // WEBSITE master layout
        $source = "{$this->basePath}resources{$this->ds}views{$this->ds}layouts{$this->ds}website.blade.php";
        $destination = resource_path("views{$this->ds}layouts");
        $this->copyFilesFromSource($source, $destination);

        // PARTIALS
        $source = "{$this->basePath}resources{$this->ds}views{$this->ds}partials";
        $destination = resource_path("views{$this->ds}partials");
        $this->copyFilesFromSource($source, $destination);

        // CONTROLLERS
        $source = "{$this->appPath}Controllers{$this->ds}Website";
        $destination = app_path("Http{$this->ds}Controllers{$this->ds}Website");

        // copy files and replace namespace and views only
        $this->copyFilesFromSource($source, $destination, 'namespace_views');

        // SEEDS
        $search = "{$this->baseNamespace}\Seeds;";
        $source = "{$this->basePath}database{$this->ds}seeds{$this->ds}UsersTableSeeder.php";
        $destination = database_path("seeds");
        $this->copyFilesFromSource($source, $destination, $search, "");

        // EVENTS (todo, admin for now)
        // MAILS (todo, admin for now)
        // NOTIFICATIONS (todo, admin for now)

        // webpack.js, packages.json root files
        $base = $source = $this->basePath . "resources" . $this->ds . "assets_setup" . $this->ds;
        $source = [
            $base . "webpack.mix.js",
            $base . "package.json",
            $base . "package-lock.json",
        ];
        $this->copyFilesFromSource($source, base_path(), false);

        // ASSETS
        $source = "{$this->basePath}resources{$this->ds}assets{$this->ds}";
        $destination = resource_path("assets{$this->ds}");
        // css
        $this->copyFilesFromSource("{$source}css", "{$destination}css", false);
        // fonts
        $this->copyFilesFromSource("{$source}fonts", "{$destination}fonts", false);
        // images
        $this->copyFilesFromSource("{$source}images", "{$destination}images", false);
        // js
        $this->copyFilesFromSource("{$source}js", "{$destination}js", false);
        // sass
        $this->copyFilesFromSource("{$source}sass", "{$destination}sass", false);

        // public/assets
        $this->copyFilesFromSource($this->basePath . 'public', base_path('public'));
    }
1248965
function copyFile (src, done) {
        var dest = path.join(outdir, path.relative(compiler.dirname, src))
        var dirname = utils.dirname(dest)

        if (dirname === dest) {
          copy(src, dest, compiler.dirname, done)
        } else {
          mkdirp(dirname, function (err) {
            if (err) return done(err)
            copy(src, dest, compiler.dirname, done)
          })
        }
      }
131386
def move(self, filename, target):
        '''
        
        '''
        self.copy(filename, target)
        self.delete(filename)
140740
public function copyFolders()
    {
        // Copy folder for compression file
        foreach ($this->folders as $folder) {
            $this->filesystem->mirror($this->rootPath.'/'.$folder, $this->outputPath.'folders/'.$folder);
        }
    }