Re: JavaFSAdaptor and non-working EO methods
Re: JavaFSAdaptor and non-working EO methods
- Subject: Re: JavaFSAdaptor and non-working EO methods
- From: Joe Little <email@hidden>
- Date: Thu, 21 May 2009 11:36:01 -0700
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@hidden> wrote:
> On Thu, May 21, 2009 at 7:39 AM, Anjo Krank <email@hidden> 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@hidden)
>> Help/Unsubscribe/Update your Subscription:
>>
>> This email sent to email@hidden
>>
>
Attachment:
JavaFSAdaptor.diff
Description: Binary data
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden