<commit_before>package org.dannil.httpdownloader.utility;

import java.io.File;
import java.io.IOException;
import java.net.URL;

import org.apache.commons.io.FileUtils;
import org.apache.commons.io.FilenameUtils;
import org.dannil.httpdownloader.model.Download;

/**
 * Class which handles operations on files.
 * 
 * @author <NAME>
 */
public class FileUtility {

	private FileUtility() {
		throw new UnsupportedOperationException(ResourceUtility.getErrorBundle().getString("disallowed_instantiation"));
	}

	/** 
	 * Get a file from the specified download's URL.
	 * 
	 * @param download
	 * 					- The download to fetch the URL from
	 * 
	 * @return A file with the contents of the specified URL
	 * 
	 * @throws IOException 
	 * 				if the file can't be fetched
	 */
	public static final File getFileFromURL(final Download download) throws IOException {
		final String name = FilenameUtils.getBaseName(download.getUrl());
		final String extension = FilenameUtils.getExtension(download.getUrl());

		final File file = new File(download.getFormat());
		FileUtils.copyURLToFile(new URL(download.getUrl()), file, 5000, 5000);
		return file;
	}

	/**
	 * Save a file to the disk.
	 * 
	 * @param file
	 * 				- The file to be saved
	 * 
	 * @return A file which reflects the file that was saved to the disk
	 * 
	 * @throws IOException 
	 * 				if the file couldn't be saved
	 */
	public static final File saveToDrive(final File file) throws IOException {
		final File destination = new File(PathUtility.DOWNLOADS_PATH);

		FileUtils.copyFileToDirectory(file, destination);

		return file;
	}<commit_msg>Removed unnecessary code due to previous commit (see commit 0e3331a)<commit_after>package org.dannil.httpdownloader.utility;

import java.io.File;
import java.io.IOException;
import java.net.URL;

import org.apache.commons.io.FileUtils;
import org.dannil.httpdownloader.model.Download;

/**
 * Class which handles operations on files.
 * 
 * @author <NAME>
 */
public class FileUtility {

	private FileUtility() {
		throw new UnsupportedOperationException(ResourceUtility.getErrorBundle().getString("disallowed_instantiation"));
	}

	/** 
	 * Get a file from the specified download's URL.
	 * 
	 * @param download
	 * 					- The download to fetch the URL from
	 * 
	 * @return A file with the contents of the specified URL
	 * 
	 * @throws IOException 
	 * 				if the file can't be fetched
	 */
	public static final File getFileFromURL(final Download download) throws IOException {
		final File file = new File(download.getFormat());
		FileUtils.copyURLToFile(new URL(download.getUrl()), file, 5000, 5000);
		return file;
	}

	/**
	 * Save a file to the disk.
	 * 
	 * @param file
	 * 				- The file to be saved
	 * 
	 * @return A file which reflects the file that was saved to the disk
	 * 
	 * @throws IOException 
	 * 				if the file couldn't be saved
	 */
	public static final File saveToDrive(final File file) throws IOException {
		final File destination = new File(PathUtility.DOWNLOADS_PATH);

		FileUtils.copyFileToDirectory(file, destination);

		return file;
	}
{'fraction_non_alphanumeric': 0.0946033810143043, 'fraction_numerical': 0.0068270481144343306, 'mean_word_length': 3.7120980091883613, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 22, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2496358', 'n_tokens_mistral': 1005, 'n_tokens_neox': 876, 'n_words': 291}