class FileSystemUtils {

	public static <F> F copyFile(IBasicFileSystem<F> fileSystem, F file, String destinationFolder, boolean overwrite, int numOfBackups, boolean createFolders) throws FileSystemException {
		prepareDestination(fileSystem, file, destinationFolder, overwrite, numOfBackups, createFolders);
		F newFile = fileSystem.copyFile(file, destinationFolder, createFolders);
		if (newFile == null) {
			throw new FileSystemException("cannot copy file [" + fileSystem.getName(file) + "] to [" + destinationFolder + "]");
		}
		return newFile;
	}

}