Package vg.core.exception

Examples of vg.core.exception.LogException


    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));
    }
  }
View Full Code Here

TOP

Related Classes of vg.core.exception.LogException

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.