Looking at the code in PutMethod.java the content.store() is called when replacing existing content i.e. when content.retrieve() does not throw an ObjectNotFoundException.
content.create() is called when we're creating new content (and subsequently a PUT_AFTER event is thrown) but in doing some testing I see that the content isn't actually persisted to disk until the response is sent and thus I still won't be able to get an InputStream in my client by using WebdavResource.getMethodData(). Cheers, Brandon ---- On Tue, 26 Jul 2005, Thomas Bellembois ([EMAIL PROTECTED]) wrote: > Hi, > > Apparently, in the source code (putMethod.java) the content is stored > before the putAfter event is thrown : > > content.store(slideToken, resourcePath, revisionDescriptor, > revisionContent); > > But I am not very aware of the complex Slide mechanism... > > You could try to retrieve the bytes of the NodeRevisionContent : > > AbstractWebdavMethod method = > (AbstractWebdavMethod)event.getSource(); > SlideToken slideToken = method.getSlideToken(); > Content content = method.getContent(); > HttpServletRequest request = method.getRequest(); > String uri = request.getRequestURI(); > String slideContext = request.getContextPath(); > uri = uri.substring(slideContext.length()); > NodeRevisionDescriptors nrds = content.retrieve(slideToken, uri); > NodeRevisionDescriptor nrd = content.retrieve(slideToken, nrds); > NodeRevisionContent nrdContent = content.retrieve(slideToken, > nrds, nrd); > nrdContent.getContentBytes(); > > Hope it works and it helps, > > Thomas > > Brandon Dove wrote: > > >OK, so I've updated to a head build and now am working with code > >that includes the DetailedWebdavListener and WebdavAdapter. My > >listener now implements the putAfter() method, but I'm seeing > >the same problem I was experiencing before: > > > >When the putAfter() event occurs the content has not been stored > >in the Slide repository and thus I cannot get an InputStream > >from it. > > > >Any suggestions? > > > >Cheers, > > > >Brandon > > > > > > > >---- On Mon, 25 Jul 2005, Thomas Bellembois > >([EMAIL PROTECTED]) wrote: > > > > > > > >>Hi, > >> > >>Have you tried with the DetailedWebdavListener ? The > >> > >> > >"putAfter" event is > > > > > >>thrown just after a resource is put on the server. > >>You should be able to retrieve your inputStream using the > >> > >> > >WebdavEvent. > > > > > >>Hope it helps. > >> > >>Thomas > >> > >> > >>Brandon Dove wrote: > >> > >> > >> > >>>Hi -- I'm writing some code that will: > >>> > >>>1. Extended ContentAdaptor to listen for "create" > >>> > >>> > >ContentEvents. > > > > > >>>2. Determine if the resource being created is an image. > >>>3. Get an InputStream from that resource to do some further > >>>processing of the image. > >>> > >>>The problem I've run into is that I'm notified of the > >>> > >>> > >"create" > > > > > >>>event, but at this point the resource doesn't actually exist > >>> > >>> > >in > > > > > >>>the slide repository so attempting to get an InputStream from > >>>that resource is useless. I've tried listening for other > >>>ContentEvents like "store" but they seem to have the same > >>>result. What event should I be listening for in this > >>> > >>> > >situation? > > > > > >>>Thanks again for your help. > >>> > >>>Cheers, > >>> > >>>Brandon > >>> > >>>________________________________________________ > >>>Get your own "800" number > >>>Voicemail, fax, email, and a lot more > >>>http://www.ureach.com/reg/tag > >>> > >>> > >>> > >>--------------------------------------------------------------------- > >> > >> > >>>To unsubscribe, e-mail: > >>> > >>> > >[EMAIL PROTECTED] > > > > > >>>For additional commands, e-mail: > >>> > >>> > >[EMAIL PROTECTED] > > > > > >>> > >>> > >>> > >>> > >>-- > >>+---=( Thomas Bellembois )=---+ > >>| CRI - University of Rennes 1 - FR | > >>| [EMAIL PROTECTED] | > >>| +33 2 23 23 69 60 | > >>+-----------------------------------+ > >> > >> > >> > >> > >> > >--------------------------------------------------------------------- > > > > > >>To unsubscribe, e-mail: > >> > >> > >[EMAIL PROTECTED] > > > > > >>For additional commands, e-mail: > >> > >> > >[EMAIL PROTECTED] > > > > > >> > >> > >> > > > > > >________________________________________________ > >Get your own "800" number > >Voicemail, fax, email, and a lot more > >http://www.ureach.com/reg/tag > > > >--------------------------------------------------------------------- > >To unsubscribe, e-mail: [EMAIL PROTECTED] > >For additional commands, e-mail: [EMAIL PROTECTED] > > > > > > > > > > > -- > +---=( Thomas Bellembois )=---+ > | CRI - University of Rennes 1 - FR | > | [EMAIL PROTECTED] | > | +33 2 23 23 69 60 | > +-----------------------------------+ > > > --------------------------------------------------------------------- > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > > > ________________________________________________ Get your own "800" number Voicemail, fax, email, and a lot more http://www.ureach.com/reg/tag --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]