replace "/" with java/io/File.separator
authormh <mh>
Mon, 4 Nov 2002 04:31:59 +0000 (04:31 +0000)
committermh <mh>
Mon, 4 Nov 2002 04:31:59 +0000 (04:31 +0000)
source/mircoders/media/MediaHandlerGeneric.java

index f0402e7..1088ea9 100755 (executable)
@@ -66,8 +66,11 @@ public class MediaHandlerGeneric implements MirMedia
 {
     protected static String imageHost = MirConfig.getProp("Producer.Image.Host");
     protected static String imageRoot = MirConfig.getProp("Producer.ImageRoot");
-    protected static Logfile theLog = Logfile.getInstance(MirConfig.getProp("Home")+
+    protected static Logfile theLog = Logfile.getInstance(
+                                                  MirConfig.getProp("Home")+
                                                   "log/media.log");
+    private final String sepChar = File.separator;
+
     public void set (InputStream in, Entity ent, Entity mediaTypeEnt )
         throws MirMediaException {
 
@@ -76,9 +79,9 @@ public class MediaHandlerGeneric implements MirMedia
         String date = ent.getValue("date");
         String datePath = StringUtil.webdbDate2path(date);
         try {
-            long size = FileUtil.write(getStoragePath()+"/"+datePath+"/"+
-                                      mediaFname, in);
-            ent.setValueForProperty("publish_path",datePath+"/"+mediaFname);
+            long size = FileUtil.write(getStoragePath()+sepChar+datePath+
+                                      sepChar+mediaFname, in);
+            ent.setValueForProperty("publish_path",datePath+sepChar+mediaFname);
             ent.setValueForProperty("size", new Long(size).toString());
             ent.update();
         } catch (Exception e) {