[prev in list] [next in list] [prev in thread] [next in thread] 

List:       httpclient-users
Subject:    Re: HttpClient API - upload files using OutputStream not Filepart
From:       Oleg Kalnichevski <olegk () apache ! org>
Date:       2012-05-22 7:30:14
Message-ID: 20120522073014.GA19227 () kalnich ! nine ! ch
[Download RAW message or body]

On Tue, May 22, 2012 at 10:24:07AM +0300, Emilian Utma wrote:
> Hello Oleg,
> 
> Thank you for your reply.
> 
> I'll try to implement a "homemade" httpclient based on the Apache HttpCore
> component.
> 
> Best regards,
> Emil
> 

Let me know if you need help with the API.

Oleg


> On Mon, May 21, 2012 at 6:48 PM, Oleg Kalnichevski <olegk@apache.org> wrote:
> 
> > On Mon, 2012-05-21 at 17:13 +0300, Emilian Utma wrote:
> > > Hello,
> > >
> > > Thank you for your quick reply.
> > >
> > > This is indeed a solution but I'm afraid it won't solve my problem
> > (sorry,
> > > I wasn't very specific in my issue). Unfortunately I don't have access to
> > > the inputStream, I can only expose the outputstream (as a
> > > WritableByteChannel) to the other application because the writing is
> > > provided by it. If I use the HttpEntity interface then I have to modify
> > > that application to implement HttpEntity ... which is not possible ...
> > >
> > > Thank you anyway.
> > >
> > > Best regards,
> > > Emil
> > >
> >
> > Emil
> >
> > It is a conscious design decision to not expose the underling socket and
> > its input and output streams to HttpClient API consumers. This enables
> > HttpClient to ensure that persistent connections are always in a
> > consistent state when kept alive. You still have an option of dropping
> > to HttpCore and implementing your own HTTP connection API while still
> > re-using framework's transport and connection pooling capabilities.
> >
> > Oleg
> >
> >
> > > P.S. I'm trying to implement a some kind of "HttpContentWriter" module
> > in a
> > > ECM framework where all the content of documents (e.g. files) will be
> > > uploaded on a storage device using HTTP protocol.
> > >
> > > On Mon, May 21, 2012 at 4:12 PM, Mark Claassen <mac01@donnell.com>
> > wrote:
> > >
> > > > It is pretty easy to make your own HttpEntity.  There are just a few
> > > > methods.  You can just implement this interface to wrap
> > > > whatever object you are dealing with.  Then in the writeTo method, you
> > can
> > > > read from your stream and write it out right away.
> > > >
> > > > -----Original Message-----
> > > > From: Emilian Utma [mailto:utma.emilian@gmail.com]
> > > > Sent: Monday, May 21, 2012 8:55 AM
> > > > To: httpclient-users@hc.apache.org
> > > > Subject: HttpClient API - upload files using OutputStream not Filepart
> > > >
> > > > Hello,
> > > >
> > > > I want to know if is possible to upload a file which its content is set
> > > > via a java.io.OutputStream (as in "old times" when using
> > > > java.net.HttpURLConnection) not
> > > > org.apache.commons.httpclient.methods.multipart.FilePart.Filepart.
> > > >
> > > > I need this behaviour because the content is provided by another
> > > > application not mine. To save the content in a "temp" zone is not
> > > > an option because it is possible to receive hundreds of files per
> > seconds
> > > > ... and this will require a "big temp".
> > > >
> > > > Thank you in advance.
> > > >
> > > > Best regards,
> > > > Emil
> > > >
> > > >
> > > > ---------------------------------------------------------------------
> > > > To unsubscribe, e-mail: httpclient-users-unsubscribe@hc.apache.org
> > > > For additional commands, e-mail: httpclient-users-help@hc.apache.org
> > > >
> > > >
> >
> >
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: httpclient-users-unsubscribe@hc.apache.org
> > For additional commands, e-mail: httpclient-users-help@hc.apache.org
> >
> >

---------------------------------------------------------------------
To unsubscribe, e-mail: httpclient-users-unsubscribe@hc.apache.org
For additional commands, e-mail: httpclient-users-help@hc.apache.org

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic