Commit 9021e527 authored by wwalkowski's avatar wwalkowski

--no commit message

--no commit message
parent 343a7f52
package parser;
import java.text.SimpleDateFormat;
import java.util.Calendar;
import java.util.TimeZone;
import java.io.*;
public class Utilities
{
private static final String outputResultsFile = "C:\\outputResults";
private static final String outputCountFile = "C:\\outputCount";
public static void main(String[] args)
{
System.out.println ( "time: " + new Utilities().getTimeStamp() );
}
public String getCountFileName()
{
// return dlnaOutputCountFile + "_" + getTimeStamp() + ".txt";
return outputCountFile + ".txt";
}
public String getResultsFileName()
{
// return dlnaOutputResultsFile + "_" + getTimeStamp() + ".csv";
return outputResultsFile + ".csv";
}
public String getTimeStamp()
{
TimeZone tz_gmt = TimeZone.getDefault();
// SimpleDateFormat sdf = new SimpleDateFormat ( "EEE-MMM/d-HH:mm:ss" );
SimpleDateFormat sdf = new SimpleDateFormat ( "yyyy_MM_d_HH_mm_ss" );
sdf.setTimeZone(tz_gmt);
return sdf.format ( Calendar.getInstance().getTime() );
}
public String getExceptionString ( Exception e )
{
String retValue = null;
StringWriter sw = null;
PrintWriter pw = null;
try
{
sw = new StringWriter();
pw = new PrintWriter(sw);
e.printStackTrace(pw);
retValue = sw.toString();
}
finally
{
try
{
if(pw != null) pw.close();
if(sw != null) sw.close();
}
catch (IOException ignore)
{}
}
return retValue;
}
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment