better way to create temp. files
authormh <mh>
Wed, 27 Nov 2002 21:16:54 +0000 (21:16 +0000)
committermh <mh>
Wed, 27 Nov 2002 21:16:54 +0000 (21:16 +0000)
source/mircoders/entity/EntityImages.java

index 4376030..6f71820 100755 (executable)
@@ -54,15 +54,13 @@ import mir.storage.*;
  * Diese Klasse enthält die Daten eines MetaObjekts
  *
  * @author RK, mh
- * @version $Id: EntityImages.java,v 1.6.4.3 2002/11/15 22:06:49 mh Exp $
+ * @version $Id: EntityImages.java,v 1.6.4.4 2002/11/27 21:16:54 mh Exp $
  */
 
 
 public class EntityImages extends EntityUploadedMedia
 {
 
-  Random r = new Random();
-
        public EntityImages()
        {
                super();
@@ -130,8 +128,8 @@ public class EntityImages extends EntityUploadedMedia
 
                                theLog.printDebugInfo("settimage :: making internal representation of image");
 
-        String fName = MirConfig.getProp("TempDir")+File.separator+r.nextInt();
-        f = new File(fName);
+        File tempDir = new File(MirConfig.getProp("TempDir"));
+        f = File.createTempFile("mir", ".tmp", tempDir);
         FileUtil.write(f, in);
                                WebdbImage webdbImage= new WebdbImage(f, type);
                                theLog.printDebugInfo("settimage :: made internal representation of image");