Re: MultipartPostMethod Holding File Stream Open?

2003-02-25 Thread Daniel Walsh
> This should be fixed now.  The FileInputStream was not being closed 
> after posting.

Great.  I'll go ahead a re-download the API.

Thanks for addressing it so quickly.



-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: MultipartPostMethod Holding File Stream Open?

2003-02-25 Thread Michael Becke
This should be fixed now.  The FileInputStream was not being closed 
after posting.

Mike

On Tuesday, February 25, 2003, at 08:05 PM, Daniel Walsh wrote:

I'm using a MultipartPostMethod to upload a file to a servlet:

File file = new File(strUrl);

HttpClient client = new HttpClient();
HostConfiguration hostConfig = new HostConfiguration();
MultipartPostMethod mpPost = new MultipartPostMethod();
 hostConfig.setHost(someURL.getHost(), someURL.getPort(), 
someURL.getProtocol());
client.setConnectionTimeout(3);
client.setHostConfiguration(hostConfig);

mpPost.addParameter("someName", "someValue");
mpPost.addParameter(file.getName(), file);
mpPost.setPath(strPath);
client.executeMethod(mpPost);
String confirmUpload = tpPost.getResponseBodyAsString();
mpPost.releaseConnection();
file.delete();  // this is being blocked.

After the upload, I would like to delete the file off of my disk.  
Using other methods of uploading the file (in particular a PutMethod), 
I was able to then delete the file after the upload.  Now that I am 
using the MultipartPostMethod obj for the upload, I am unable to 
delete the file (the return value is false, and there is no 
SecurityException being thrown - no SecurityManager even set as of 
this point either).

So, I guess my question is whether there is a call to the 
MultipartPostMethod obj that I'm overlooking that would release it's 
connection (I'm sure that it is opening an InputStream of some sort to 
read the file contents, in order to form the HTTP message) to the file 
- so that I can then have unimpeded access to it for other operations?


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


DO NOT REPLY [Bug 17409] - MultipartPostMethod Holding File Stream Open?

2003-02-25 Thread bugzilla
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG 
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://nagoya.apache.org/bugzilla/show_bug.cgi?id=17409>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND 
INSERTED IN THE BUG DATABASE.

http://nagoya.apache.org/bugzilla/show_bug.cgi?id=17409

MultipartPostMethod Holding File Stream Open?

[EMAIL PROTECTED] changed:

   What|Removed |Added

 Status|NEW |RESOLVED
 Resolution||FIXED

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



DO NOT REPLY [Bug 17409] - MultipartPostMethod Holding File Stream Open?

2003-02-25 Thread bugzilla
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG 
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://nagoya.apache.org/bugzilla/show_bug.cgi?id=17409>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND 
INSERTED IN THE BUG DATABASE.

http://nagoya.apache.org/bugzilla/show_bug.cgi?id=17409

MultipartPostMethod Holding File Stream Open?





--- Additional Comments From [EMAIL PROTECTED]  2003-02-26 02:29 ---
Created an attachment (id=5028)
Fix Patch

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



DO NOT REPLY [Bug 17409] New: - MultipartPostMethod Holding File Stream Open?

2003-02-25 Thread bugzilla
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG 
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://nagoya.apache.org/bugzilla/show_bug.cgi?id=17409>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND 
INSERTED IN THE BUG DATABASE.

http://nagoya.apache.org/bugzilla/show_bug.cgi?id=17409

MultipartPostMethod Holding File Stream Open?

   Summary: MultipartPostMethod Holding File Stream Open?
   Product: Commons
   Version: 2.0 Alpha 3
  Platform: All
OS/Version: All
Status: NEW
  Severity: Normal
  Priority: Other
 Component: HttpClient
AssignedTo: [EMAIL PROTECTED]
ReportedBy: [EMAIL PROTECTED]
CC: [EMAIL PROTECTED]


From: "Daniel Walsh" <[EMAIL PROTECTED]>
Date: Tue Feb 25, 2003  8:05:49 PM US/Eastern
To: "Commons HttpClient Project" <[EMAIL PROTECTED]>
Subject: MultipartPostMethod Holding File Stream Open?
Reply-To: "Commons HttpClient Project" <[EMAIL PROTECTED]>

I'm using a MultipartPostMethod to upload a file to a servlet:

File file = new File(strUrl);

HttpClient client = new HttpClient();
HostConfiguration hostConfig = new HostConfiguration();
MultipartPostMethod mpPost = new MultipartPostMethod();

 hostConfig.setHost(someURL.getHost(), someURL.getPort(), someURL.getProtocol());
client.setConnectionTimeout(3);
client.setHostConfiguration(hostConfig);

mpPost.addParameter("someName", "someValue");
mpPost.addParameter(file.getName(), file);

mpPost.setPath(strPath);
client.executeMethod(mpPost);

String confirmUpload = tpPost.getResponseBodyAsString();
mpPost.releaseConnection();

file.delete();  // this is being blocked.

After the upload, I would like to delete the file off of my disk.  Using other
methods of uploading the file (in particular a PutMethod), I was able to then
delete the file after the upload.  Now that I am using the MultipartPostMethod
obj for the upload, I am unable to delete the file (the return value is false,
and there is no SecurityException being thrown - no SecurityManager even set as
of this point either).

So, I guess my question is whether there is a call to the MultipartPostMethod
obj that I'm overlooking that would release it's connection (I'm sure that it is
opening an InputStream of some sort to read the file contents, in order to form
the HTTP message) to the file - so that I can then have unimpeded access to it
for other operations?

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



MultipartPostMethod Holding File Stream Open?

2003-02-25 Thread Daniel Walsh
I'm using a MultipartPostMethod to upload a file to a servlet:

File file = new File(strUrl);

HttpClient client = new HttpClient();
HostConfiguration hostConfig = new HostConfiguration();
MultipartPostMethod mpPost = new MultipartPostMethod();

 hostConfig.setHost(someURL.getHost(), someURL.getPort(), someURL.getProtocol());
client.setConnectionTimeout(3);
client.setHostConfiguration(hostConfig);

mpPost.addParameter("someName", "someValue");
mpPost.addParameter(file.getName(), file);

mpPost.setPath(strPath);
client.executeMethod(mpPost);

String confirmUpload = tpPost.getResponseBodyAsString();
mpPost.releaseConnection();

file.delete();  // this is being blocked.

After the upload, I would like to delete the file off of my disk.  Using other methods 
of uploading the file (in particular a PutMethod), I was able to then delete the file 
after the upload.  Now that I am using the MultipartPostMethod obj for the upload, I 
am unable to delete the file (the return value is false, and there is no 
SecurityException being thrown - no SecurityManager even set as of this point either).

So, I guess my question is whether there is a call to the MultipartPostMethod obj that 
I'm overlooking that would release it's connection (I'm sure that it is opening an 
InputStream of some sort to read the file contents, in order to form the HTTP message) 
to the file - so that I can then have unimpeded access to it for other operations?