public static void delete(String[] files, boolean bDisplayInfo) { for (int i = 0; i < files.length; i++) { delete(files[i], bDisplayInfo); } }
public void deleteTemporaryFiles(WeightedCodebookFeatureCollection fcol, BaselineAdaptationSet sourceTrainingSet, BaselineAdaptationSet targetTrainingSet) { FileUtils.delete(fcol.indexMapFiles, true); // FileUtils.delete(sourceTrainingSet.getLsfFiles(), true); // FileUtils.delete(targetTrainingSet.getLsfFiles(), true); // FileUtils.delete(sourceTrainingSet.getF0Files(), true); // FileUtils.delete(targetTrainingSet.getF0Files(), true); // FileUtils.delete(sourceTrainingSet.getEnergyFiles(), true); // FileUtils.delete(targetTrainingSet.getEnergyFiles(), true); FileUtils.delete(wcParams.temporaryCodebookFile); } }
public void deleteTemporaryFiles(WeightedCodebookFeatureCollection fcol, BaselineAdaptationSet sourceTrainingSet, BaselineAdaptationSet targetTrainingSet) { FileUtils.delete(fcol.indexMapFiles, true); // FileUtils.delete(sourceTrainingSet.getLsfFiles(), true); // FileUtils.delete(targetTrainingSet.getLsfFiles(), true); // FileUtils.delete(sourceTrainingSet.getF0Files(), true); // FileUtils.delete(targetTrainingSet.getF0Files(), true); // FileUtils.delete(sourceTrainingSet.getEnergyFiles(), true); // FileUtils.delete(targetTrainingSet.getEnergyFiles(), true); FileUtils.delete(wcParams.temporaryCodebookFile); } }
public static void delete(String[] files, boolean bDisplayInfo) { for (int i = 0; i < files.length; i++) { delete(files[i], bDisplayInfo); } }
public static void delete(String[] files) { delete(files, false); }
public static void delete(String[] files) { delete(files, false); }
public static void delete(String file) { if (exists(file)) { delete(file, false); } }
public static void delete(String file) { if (exists(file)) { delete(file, false); } }
private void init(String codebookFile, int desiredStatus) { status = NOT_OPENED; stream = null; currentFile = ""; if (desiredStatus == OPEN_FOR_READ) { status = desiredStatus; try { stream = new MaryRandomAccessFile(codebookFile, "r"); currentFile = codebookFile; } catch (FileNotFoundException e) { // TODO Auto-generated catch block e.printStackTrace(); } } else if (desiredStatus == OPEN_FOR_WRITE) { FileUtils.delete(codebookFile); status = desiredStatus; try { stream = new MaryRandomAccessFile(codebookFile, "rw"); currentFile = codebookFile; } catch (FileNotFoundException e) { // TODO Auto-generated catch block e.printStackTrace(); } } }
public SmoothingFile(String filename, int desiredStatus, int smoothingMethodIn) // smoothingMethod only effective when writing // to file { status = NOT_OPENED; stream = null; totalEntries = 0; smoothingMethod = smoothingMethodIn; if (desiredStatus == OPEN_FOR_READ) { status = desiredStatus; try { stream = new MaryRandomAccessFile(filename, "r"); } catch (FileNotFoundException e) { // TODO Auto-generated catch block e.printStackTrace(); } } else if (desiredStatus == OPEN_FOR_WRITE) { FileUtils.delete(filename); status = desiredStatus; try { stream = new MaryRandomAccessFile(filename, "rw"); } catch (FileNotFoundException e) { // TODO Auto-generated catch block e.printStackTrace(); } } }
private void init(String pitchMappingFile, int desiredStatus) { status = NOT_OPENED; stream = null; currentFile = ""; if (desiredStatus == OPEN_FOR_READ) { status = desiredStatus; try { stream = new MaryRandomAccessFile(pitchMappingFile, "r"); currentFile = pitchMappingFile; } catch (FileNotFoundException e) { // TODO Auto-generated catch block e.printStackTrace(); } } else if (desiredStatus == OPEN_FOR_WRITE) { FileUtils.delete(pitchMappingFile); status = desiredStatus; try { stream = new MaryRandomAccessFile(pitchMappingFile, "rw"); currentFile = pitchMappingFile; } catch (FileNotFoundException e) { // TODO Auto-generated catch block e.printStackTrace(); } } }
private void init(String pitchMappingFile, int desiredStatus) { status = NOT_OPENED; stream = null; currentFile = ""; if (desiredStatus == OPEN_FOR_READ) { status = desiredStatus; try { stream = new MaryRandomAccessFile(pitchMappingFile, "r"); currentFile = pitchMappingFile; } catch (FileNotFoundException e) { // TODO Auto-generated catch block e.printStackTrace(); } } else if (desiredStatus == OPEN_FOR_WRITE) { FileUtils.delete(pitchMappingFile); status = desiredStatus; try { stream = new MaryRandomAccessFile(pitchMappingFile, "rw"); currentFile = pitchMappingFile; } catch (FileNotFoundException e) { // TODO Auto-generated catch block e.printStackTrace(); } } }
private void init(String codebookFile, int desiredStatus) { status = NOT_OPENED; stream = null; currentFile = ""; if (desiredStatus == OPEN_FOR_READ) { status = desiredStatus; try { stream = new MaryRandomAccessFile(codebookFile, "r"); currentFile = codebookFile; } catch (FileNotFoundException e) { // TODO Auto-generated catch block e.printStackTrace(); } } else if (desiredStatus == OPEN_FOR_WRITE) { FileUtils.delete(codebookFile); status = desiredStatus; try { stream = new MaryRandomAccessFile(codebookFile, "rw"); currentFile = codebookFile; } catch (FileNotFoundException e) { // TODO Auto-generated catch block e.printStackTrace(); } } }
public SmoothingFile(String filename, int desiredStatus, int smoothingMethodIn) // smoothingMethod only effective when writing // to file { status = NOT_OPENED; stream = null; totalEntries = 0; smoothingMethod = smoothingMethodIn; if (desiredStatus == OPEN_FOR_READ) { status = desiredStatus; try { stream = new MaryRandomAccessFile(filename, "r"); } catch (FileNotFoundException e) { // TODO Auto-generated catch block e.printStackTrace(); } } else if (desiredStatus == OPEN_FOR_WRITE) { FileUtils.delete(filename); status = desiredStatus; try { stream = new MaryRandomAccessFile(filename, "rw"); } catch (FileNotFoundException e) { // TODO Auto-generated catch block e.printStackTrace(); } } }
public static void copyFolderRecursive(String sourceFolder, String targetFolder, boolean bForceDeleteTarget) throws IOException { String fileSeparator = System.getProperty("file.separator"); if (exists(sourceFolder)) { if (exists(targetFolder) && bForceDeleteTarget) delete(targetFolder); createDirectory(targetFolder); if (exists(targetFolder)) { String[] fileList = new File(sourceFolder).list(); if (fileList != null) { for (int i = 0; i < fileList.length; i++) { if (!fileList[i].startsWith(".")) { String source = StringUtils.checkLastSlash(sourceFolder) + fileList[i]; if (new File(source).isDirectory()) { String newTargetFolder = StringUtils.checkLastSlash(targetFolder) + fileList[i]; copyFolderRecursive(source, newTargetFolder, bForceDeleteTarget); } else { String targetFile = StringUtils.checkLastSlash(targetFolder) + fileList[i]; copy(source, targetFile); } } } } } else System.out.println("Could not create target folder!"); } else System.out.println("Source folder does not exist!"); }
public static void copyFolderRecursive(String sourceFolder, String targetFolder, boolean bForceDeleteTarget) throws IOException { String fileSeparator = System.getProperty("file.separator"); if (exists(sourceFolder)) { if (exists(targetFolder) && bForceDeleteTarget) delete(targetFolder); createDirectory(targetFolder); if (exists(targetFolder)) { String[] fileList = new File(sourceFolder).list(); if (fileList != null) { for (int i = 0; i < fileList.length; i++) { if (!fileList[i].startsWith(".")) { String source = StringUtils.checkLastSlash(sourceFolder) + fileList[i]; if (new File(source).isDirectory()) { String newTargetFolder = StringUtils.checkLastSlash(targetFolder) + fileList[i]; copyFolderRecursive(source, newTargetFolder, bForceDeleteTarget); } else { String targetFile = StringUtils.checkLastSlash(targetFolder) + fileList[i]; copy(source, targetFile); } } } } } else System.out.println("Could not create target folder!"); } else System.out.println("Source folder does not exist!"); }
public static void copyFolder(String sourceFolder, String targetFolder, boolean bForceDeleteTarget) throws IOException { if (exists(sourceFolder)) { if (exists(targetFolder) && bForceDeleteTarget) delete(targetFolder); createDirectory(targetFolder); if (exists(targetFolder)) { String[] fileList = FileUtils.getFileList(sourceFolder, "*.*"); if (fileList != null) { for (int i = 0; i < fileList.length; i++) { String targetFile = StringUtils.checkLastSlash(targetFolder) + StringUtils.getFileName(fileList[i], false); copy(fileList[i], targetFile); } } } else System.out.println("Could not create target folder!"); } else System.out.println("Source folder does not exist!"); }
public static void copyFolder(String sourceFolder, String targetFolder, boolean bForceDeleteTarget) throws IOException { if (exists(sourceFolder)) { if (exists(targetFolder) && bForceDeleteTarget) delete(targetFolder); createDirectory(targetFolder); if (exists(targetFolder)) { String[] fileList = FileUtils.getFileList(sourceFolder, "*.*"); if (fileList != null) { for (int i = 0; i < fileList.length; i++) { String targetFile = StringUtils.checkLastSlash(targetFolder) + StringUtils.getFileName(fileList[i], false); copy(fileList[i], targetFile); } } } else System.out.println("Could not create target folder!"); } else System.out.println("Source folder does not exist!"); }
public void convertToWav(AudioFormat audioformat) throws IOException { // Read the temp binary file into a wav file and delete the temp binary file if (tempOutBinaryFile != null) { double[] yOut = null; din = new LEDataInputStream(tempOutBinaryFile); yOut = din.readDouble(totalWrittenToFile); din.close(); double tmpMax = MathUtils.getAbsMax(yOut); if (tmpMax > 1.0) { for (int n = 0; n < yOut.length; n++) yOut[n] /= tmpMax; } outputAudio = new DDSAudioInputStream(new BufferedDoubleDataSource(yOut), audioformat); AudioSystem.write(outputAudio, AudioFileFormat.Type.WAVE, new File(outputFile)); FileUtils.delete(tempOutBinaryFile); // } } }
public void convertToWav(AudioFormat audioformat) throws IOException { // Read the temp binary file into a wav file and delete the temp binary file if (tempOutBinaryFile != null) { double[] yOut = null; din = new LEDataInputStream(tempOutBinaryFile); yOut = din.readDouble(totalWrittenToFile); din.close(); double tmpMax = MathUtils.getAbsMax(yOut); if (tmpMax > 1.0) { for (int n = 0; n < yOut.length; n++) yOut[n] /= tmpMax; } outputAudio = new DDSAudioInputStream(new BufferedDoubleDataSource(yOut), audioformat); AudioSystem.write(outputAudio, AudioFileFormat.Type.WAVE, new File(outputFile)); FileUtils.delete(tempOutBinaryFile); // } } }