changes made after tupshins reconstruction
[org.ibex.core.git] / src / org / xwt / util / CachedInputStream.java
index a599459..4e38954 100644 (file)
@@ -1,3 +1,10 @@
+// Copyright (C) 2003 Adam Megacz <adam@xwt.org> all rights reserved.
+//
+// You may modify, copy, and redistribute this code under the terms of
+// the GNU Library Public License version 2.1, with the exception of
+// the portion of clause 6a after the semicolon (aka the "obnoxious
+// relink clause")
+
 package org.xwt.util;
 import java.io.*;
 
@@ -21,8 +28,6 @@ public class CachedInputStream {
         this.diskCache = diskCache;
     }
     public InputStream getInputStream() throws IOException {
-        System.out.println("diskCache == " + diskCache);
-        System.out.println("diskCache.exists() == " + diskCache.exists());
         if (diskCache != null && diskCache.exists()) return new FileInputStream(diskCache);
         return new SubStream();
     }
@@ -44,14 +49,14 @@ public class CachedInputStream {
             // FIXME: probably a race here
             if (diskCache != null && !diskCache.exists())
                 try {
-                    File cacheFile = new File(diskCache + ".tmp");
+                    File cacheFile = new File(diskCache + ".incomplete");
                     FileOutputStream cacheFileStream = new FileOutputStream(cacheFile);
                     cacheFileStream.write(cache, 0, size);
                     cacheFileStream.close();
                     cacheFile.renameTo(diskCache);
                 } catch (IOException e) {
-                    Log.log(this, "exception thrown while writing disk cache");
-                    Log.log(this, e);
+                    Log.info(this, "exception thrown while writing disk cache");
+                    Log.info(this, e);
                 }
         }
         else size += ret;