<commit_before>package nak.nakloidGUI.actions.executors;

import java.io.IOException;
import java.nio.file.Files;
import java.nio.file.Path;
import java.nio.file.Paths;

import org.eclipse.jface.dialogs.MessageDialog;
import org.eclipse.swt.SWT;
import org.eclipse.swt.widgets.FileDialog;

import nak.nakloidGUI.actions.AbstractAction;
import nak.nakloidGUI.coredata.CoreData;
import nak.nakloidGUI.gui.MainWindow;

public class ExportWavAction extends AbstractAction {
	final String[] ext = {"*.wav"};
	final String [] filterNames = {"RIFF waveform Audio Format (*.wav)"};

	public ExportWavAction(MainWindow mainWindow, CoreData coreData) {
		super(mainWindow, coreData);
		setText("書き出し(&E)@Ctrl+E");
		setAccelerator(SWT.CTRL+'E');
	}

	@Override
	public void run() {
		FileDialog openDialog = new FileDialog(mainWindow.getShell(), SWT.SAVE);
		openDialog.setFilterExtensions(ext);
		openDialog.setFilterNames(filterNames);
		String strPath = openDialog.open();
		if (strPath==null || strPath.isEmpty()) {
			return;
		}
		mainWindow.buildAction.run();
		Path pathExportWav = Paths.get(strPath);
		Path pathWav = coreData.nakloidIni.output.path_song;
		try {
			Files.deleteIfExists(pathExportWav);
			Files.copy(pathWav, pathExportWav);
		} catch (IOException e) {
			MessageDialog.openError(mainWindow.getShell(), "NakloidGUI", "ファイル操作に失敗しました。\n"+e.toString()+e.getMessage());
		}
	}
}<commit_msg>export wav copy bugfix<commit_after>package nak.nakloidGUI.actions.executors;

import java.io.IOException;
import java.nio.file.Files;
import java.nio.file.Path;
import java.nio.file.Paths;
import java.nio.file.StandardCopyOption;

import org.eclipse.jface.dialogs.MessageDialog;
import org.eclipse.swt.SWT;
import org.eclipse.swt.widgets.FileDialog;

import nak.nakloidGUI.actions.AbstractAction;
import nak.nakloidGUI.coredata.CoreData;
import nak.nakloidGUI.gui.MainWindow;

public class ExportWavAction extends AbstractAction {
	final String[] ext = {"*.wav"};
	final String [] filterNames = {"RIFF waveform Audio Format (*.wav)"};

	public ExportWavAction(MainWindow mainWindow, CoreData coreData) {
		super(mainWindow, coreData);
		setText("書き出し(&E)@Ctrl+E");
		setAccelerator(SWT.CTRL+'E');
	}

	@Override
	public void run() {
		FileDialog openDialog = new FileDialog(mainWindow.getShell(), SWT.SAVE);
		openDialog.setFilterExtensions(ext);
		openDialog.setFilterNames(filterNames);
		String strPath = openDialog.open();
		if (strPath==null || strPath.isEmpty()) {
			return;
		}
		mainWindow.buildAction.run();
		Path pathExportWav = Paths.get(strPath);
		Path pathWav = coreData.nakloidIni.output.path_song;
		try {
			Files.deleteIfExists(pathExportWav);
			Files.copy(pathWav, pathExportWav, StandardCopyOption.REPLACE_EXISTING);
		} catch (IOException e) {
			MessageDialog.openError(mainWindow.getShell(), "NakloidGUI", "ファイル操作に失敗しました。\n"+e.toString()+e.getMessage());
		}
	}
}
{'fraction_non_alphanumeric': 0.13342550985136536, 'fraction_numerical': 0.0, 'mean_word_length': 5.622425629290618, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3829456', 'n_tokens_mistral': 1074, 'n_tokens_neox': 1018, 'n_words': 172}