Author: michiel
Date: 2009-11-23 15:54:49 +0100 (Mon, 23 Nov 2009)
New Revision: 39850
Modified:
mmbase/trunk/core/src/main/java/org/mmbase/util/SerializableInputStream.java
Log:
added an extra constructor and a method getFileName. We can make a distinction
now between 'the' name and the file name of the used temporary file (needed to
fix an issue with temporary images)
Modified:
mmbase/trunk/core/src/main/java/org/mmbase/util/SerializableInputStream.java
===================================================================
---
mmbase/trunk/core/src/main/java/org/mmbase/util/SerializableInputStream.java
2009-11-23 14:11:25 UTC (rev 39849)
+++
mmbase/trunk/core/src/main/java/org/mmbase/util/SerializableInputStream.java
2009-11-23 14:54:49 UTC (rev 39850)
@@ -71,12 +71,18 @@
/**
* @since MMBase-1.9.2
*/
- public SerializableInputStream(File tempFile) throws IOException {
+ public SerializableInputStream(File tempFile, String name) throws
IOException {
this.file = tempFile;
this.wrapped = new FileInputStream(tempFile);
this.size = tempFile.length();
- this.name = tempFile.getName();
+ this.name = name;
}
+ /**
+ * @since MMBase-1.9.2
+ */
+ public SerializableInputStream(File tempFile) throws IOException {
+ this(tempFile, tempFile.getName());
+ }
public SerializableInputStream(byte[] array) {
wrapped = new ByteArrayInputStream(array);
@@ -441,4 +447,15 @@
return file;
}
+ /**
+ * @since MMBase-1.9.2
+ */
+ public String getFileName() {
+ if (file != null) {
+ return file.getName();
+ } else {
+ return name;
+ }
+ }
+
}
_______________________________________________
Cvs mailing list
[email protected]
http://lists.mmbase.org/mailman/listinfo/cvs