if(!dir.exists() || (dir.isFile() && !dir.isFile())) {
File f = new File("log");
try {
f.mkdir();
} catch (Exception ex) {
throw(new LogException(ex.getMessage(), EnumCriticalityException.FAILED));
}
}
Date data = new Date();
long time = data.getTime();
SimpleDateFormat sdf = new SimpleDateFormat("dd.M.yyyy H.mm.ss");
String timeS = sdf.format(time);
FileOutputStream f = null;
try {
f = new FileOutputStream("log/"+timeS+"_log.txt");
this.output = new DataOutputStream(f);
this.fileName = dir.getAbsolutePath() + File.separatorChar + timeS + "_log.txt";
} catch (IOException ex) {
throw(new LogException("Warning : Couldn't to create file " + "log/"+timeS+"_log.txt", EnumCriticalityException.ERROR));
}
}