ngmf.util.DateDirectoryOutput Maven / Gradle / Ivy
/*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package ngmf.util;
import java.io.File;
import java.text.DateFormat;
import java.text.SimpleDateFormat;
import java.util.Date;
/**
*
* @author od
*/
public class DateDirectoryOutput extends OutputStragegy {
DateFormat daf = new SimpleDateFormat("yyyy-MM-dd hh.mm.ss");
public DateDirectoryOutput(File basedir) {
super(basedir);
}
@Override
public File nextOutputFolder() {
if (!basedir.exists()) {
basedir.mkdirs();
}
String filename = daf.format(new Date());
File nextFolder = new File(basedir, filename);
return nextFolder;
}
}
© 2015 - 2024 Weber Informatics LLC | Privacy Policy