Still not resolved are the issues that Chuck and are are trying to
address, but here's the diff that at least gets it to NSData and
allows content to be updated/inserted. Other stuff in the takeValueFor
is breaking, but nothing else is presently read-write.



On Thu, May 21, 2009 at 10:04 AM, Joe Little <[email protected]> wrote:
> On Thu, May 21, 2009 at 7:39 AM, Anjo Krank <[email protected]> wrote:
>>
>> Am 20.05.2009 um 22:23 schrieb Chuck Hill:
>>
>>>>>> It's been ages (6years+) since I tried to create a simple D2W app from
>>>>>> that
>>>>>> code, but AFAIR, I had no trouble writing to a file. The only downside
>>>>>> then
>>>>>> was that you don't have working rollback.
>>
>> So I may have hacked the thing a bit, way back when. There is special
>> treatment for some keys in FSAdaptorChannel:
>>
>>                   if ("content".equals(columnName)) {
>>                        try {
>>                            String path = aFile.getAbsolutePath();
>>                            InputStream in = new FileInputStream(path);
>>
>>                            if (null == in)
>>                                throw new RuntimeException("The file '" +
>> path + "' can not be opened.");
>>                            int length = inavailable();
>>                            if (length == 0) {
>>                                aValue = "";
>>                            }
>>                            byte buffer[] = new byte[length];
>>                            in.read(buffer);
>>                            in.close();
>>                            aValue = new String(buffer);
>>                        } catch (IOException ex) {
>>
>>  System.err.println("dictionaryForFileWithAttributes : (" + aFile.getName()
>> + ") " + ex);
>>                        }
>>
>>
>> which should also go to insert and update. Also the "content" should be a
>> NSData, not a String. In particular it should be an NSData class that can
>> handle streams... even better if you had a set-table file subclass that
>> would get used and defaulted to ERXFile. The actual imp is left to the
>> reader :)
>>
>> Cheers, Anjo
>
> Thanks. I'll start to work on editing the source for this and see what
> I come up with that works reliably w/o the EOF quirks I'm
> experiencing.
>
>> _______________________________________________
>> Do not post admin requests to the list. They will be ignored.
>> Webobjects-dev mailing list      ([email protected])
>> Help/Unsubscribe/Update your Subscription:
>> http://lists.apple.com/mailman/options/webobjects-dev/jmlittle%40gmail.com
>>
>> This email sent to [email protected]
>>
>

Attachment: JavaFSAdaptor.diff
Description: Binary data

 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list      ([email protected])
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/webobjects-dev/archive%40mail-archive.com

This email sent to [email protected]

Reply via email to