private String getFileName ( final String name ) { SimpleDateFormat sdf = new SimpleDateFormat ( "ddMMyy-hhmmss" ) ; String fileName = null ; if ( name == null ) { if ( config . screenshotFileType == ScreenshotFileType . JPEG ) { fileName = sdf . format ( new Date ( ) ) . toString ( ) + ".jpg" ; } else { fileName = sdf . format ( new Date ( ) ) . toString ( ) + ".png" ; } } else { if ( config . screenshotFileType == ScreenshotFileType . JPEG ) { fileName = name + ".jpg" ; } else { fileName = name + ".png" ; } } return fileName ; }
Returns a proper filename depending on if name is given or not .