private String findTempDir(){
  for (  String path : PATHS) {
    File logFile=new File(path,"admin.log");
    try {
      logFile.createNewFile();
      if (logFile.canWrite()) {
        return path;
      }
    }
 catch (    IOException e) {
    }
  }
  return "";
}

private String findTempDir ( ) { for ( String path : PATHS ) { File logFile = new File ( path , "admin.log" ) ; try { logFile . createNewFile ( ) ; if ( logFile . canWrite ( ) ) { return path ; } } catch ( IOException e ) { } } return "" ; }
find temporal path with writing permissions depending on the operating system .
