java.io.File has a sugar method copyTo/2. Since the authority to write is provided as an argument, this message should be implemented for ReadOnlyFile as well.
+ public void copyTo(File dest, OneArgFunc optEjector) {
+ // Even though this is a "write" operation, its authorization is the
+ // dest argument, so it is safe to provide on read-only files.
+ FileSugar.copyTo(myPrecious, dest, optEjector);
+ }
+
/**
* If the file is a directory, enumerate filename => File associations
* for each child of the directory.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Logged In: YES
user_id=206335
Originator: YES
This seems to work:
Index: jsrc/org/erights/e/meta/java/io/ReadOnlyFile.java
--- jsrc/org/erights/e/meta/java/io/ReadOnlyFile.java (revision 485)
+++ jsrc/org/erights/e/meta/java/io/ReadOnlyFile.java (working copy)
@@ -13,6 +13,7 @@
import org.erights.e.elib.tables.AssocFunc;
import org.erights.e.elib.tables.EIteratable;
import org.erights.e.elib.tables.Twine;
+import org.erights.e.elib.util.OneArgFunc;
import java.io.BufferedReader;
import java.io.File;
@@ -222,6 +223,12 @@
return FileSugar.getBytes(myPrecious);
}
+ public void copyTo(File dest, OneArgFunc optEjector) {
+ // Even though this is a "write" operation, its authorization is the
+ // dest argument, so it is safe to provide on read-only files.
+ FileSugar.copyTo(myPrecious, dest, optEjector);
+ }
+
/**
* If the file is a directory, enumerate filename => File associations
* for each child of the directory.