projects
/
org.ibex.js.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
0d95326
)
added support for writing Fountains in js.Directory
author
adam
<adam@megacz.com>
Mon, 21 Feb 2005 09:25:19 +0000
(09:25 +0000)
committer
adam
<adam@megacz.com>
Mon, 21 Feb 2005 09:25:19 +0000
(09:25 +0000)
darcs-hash:
20050221092519
-5007d-
8978fa6e03a32b7fa0f513c64c38faa7c54f4297
.gz
src/org/ibex/js/Directory.java
patch
|
blob
|
history
diff --git
a/src/org/ibex/js/Directory.java
b/src/org/ibex/js/Directory.java
index
a44cc77
..
0a77f41
100644
(file)
--- a/
src/org/ibex/js/Directory.java
+++ b/
src/org/ibex/js/Directory.java
@@
-5,6
+5,7
@@
package org.ibex.js;
import org.ibex.util.*;
package org.ibex.js;
import org.ibex.util.*;
+import org.ibex.io.*;
import java.io.*;
// FEATURE: support for move
import java.io.*;
// FEATURE: support for move
@@
-69,7
+70,12
@@
public class Directory extends JS.Immutable {
File f2 = new File(f.getAbsolutePath() + File.separatorChar + Encode.toFilename(key));
destroy(f2);
if (val == null) return;
File f2 = new File(f.getAbsolutePath() + File.separatorChar + Encode.toFilename(key));
destroy(f2);
if (val == null) return;
- if (val instanceof JSPrimitive) {
+ if (val instanceof org.ibex.io.Fountain) {
+ Stream stream = ((org.ibex.io.Fountain)val).getStream();
+ Stream out = new Stream(null, new FileOutputStream(f2));
+ stream.transcribe(out);
+ out.close();
+ } else if (val instanceof JSPrimitive) {
OutputStream out = new FileOutputStream(f2);
Writer w = new OutputStreamWriter(out);
w.write(JSU.toString(val));
OutputStream out = new FileOutputStream(f2);
Writer w = new OutputStreamWriter(out);
w.write(JSU.toString(val));