title: how to create temp file without random number
body: <p>I need to send pdf file  as attachment with mail. This is scheduler job which run every 2 hour.Directly it's not taking giving File Not Found Exception so i thought i put in temp directory and send from there. This job is run on JBoss Server.</p>
  
  <pre><code>File temp = null;
  String tDir = System.getProperty("java.io.tmpdir") + "SupplierGuide";try
  {
      temp = File.createTempFile(tDir, ".pdf");
      final InputStream inputStream = SendNotificationToContacts.class.getClassLoader()
              .getResourceAsStream(result.getProperty("supplier.guide"));
  
      IOUtils.copy(inputStream, new FileOutputStream(temp));
  }catch(
  Exception e)
  {
      // TODO Auto-generated catch block
      e.printStackTrace();
  }
  </code></pre>