Generate temporary filename (on system's temp path)


/ Published in: Java
Save to your folder(s)



Copy this code and paste it in your HTML
  1. private String getTmpFileName() {
  2. String tmpdir = System.getProperty(JAVA_IO_TMPDIR);
  3. String separador = System.getProperty(FILE_SEPARATOR);
  4.  
  5. if(!tmpdir.endsWith(separador)){
  6. tmpdir+= separador;
  7. }
  8.  
  9. return tmpdir+"tmp_"+UUIDGenFactory.getUUIDGen().nextUUID()+".tmp";
  10. }

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.