public String createTempFile(String prefix,String suffix,File directory) throws IllegalArgumentException, IOException {
  if (prefix.length() < 3)   throw new IllegalArgumentException("Prefix string too short");
  if (suffix == null)   suffix=".tmp";
  String folder=null;
  if (directory == null) {
    folder=getTmpFolderPath();
  }
 else {
    folder=directory.getAbsolutePath();
  }
  int counter=tmpFileCounter.getAndIncrement();
  String fileName=prefix + counter + suffix;
  String path=folder + File.separator + fileName;
  boolean created=createFile(path);
  if (!created) {
    throw new IOException();
  }
  return path;
}

public String createTempFile ( String prefix , String suffix , File directory ) throws IllegalArgumentException , IOException { if ( prefix . length ( ) < 3 ) throw new IllegalArgumentException ( "Prefix string too short" ) ; if ( suffix == null ) suffix = ".tmp" ; String folder = null ; if ( directory == null ) { folder = getTmpFolderPath ( ) ; } else { folder = directory . getAbsolutePath ( ) ; } int counter = tmpFileCounter . getAndIncrement ( ) ; String fileName = prefix + counter + suffix ; String path = folder + File . separator + fileName ; boolean created = createFile ( path ) ; if ( ! created ) { throw new IOException ( ) ; } return path ; }
create a tmp file , and return its absolute path
