On Tue, Feb 24, 2009 at 6:17 AM, yanshaozhiGmail <[email protected]> wrote: > I created a event listener to listen the Event.NODE_ADD events for specified > path ,and I put a file into repository through webdav , In window XP system > I can get jcr: data property's data not null all time, however , sometime I > can get "jcr: data" with null with mac System ,is there any different > between the to opration system about add file node ?
Oh, yes, this can be very tricky. On the Mac, the standard behaviour (either by applications or by the WebDAV filesystem) is something like this IIRC: it creates a separate file with some prefix (I think ".filename" or "~filename") where the content is actually stored, then makes the real file "filename" empty (that's why you get an empty jcr:data sometimes) and finally moves the "~filename" file to "filename". I can imagine other WebDAV fs clients have similar quirks. To work around that, you could wait for some time after you got the events, remember just the path, and then handle it later, when the file is no longer changing. Regards, Alex -- Alexander Klimetschek [email protected]
