You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@turbine.apache.org by Bartek Walter <Ba...@man.poznan.pl> on 2002/03/23 16:00:28 UTC

[PATCH Fulcrum 1.0b] DefaultFileItem.java

This simple patch was already sent packaged for Turbine 2.2 services,
now it is repackaged for Fulcrum:

- o.a.f.services.upload.DefaultFileItem.java: it tries to do a raw copy
if File.renameTo fails (in case the temporary storage directory for JVM
and the file target directory are on different volumes).

The second patch I sent (for TurbineVelocityService.java - setting
non-default encoding and charset when merging template with context) is
no longer needed for Fulcrum, it has already been fixed.

Sorry for re-sending the patch so late, I was off for a few days.

Regards,
Bartek

Re: [PATCH Fulcrum 1.0b] DefaultFileItem.java

Posted by Bartek Walter <Ba...@man.poznan.pl>.
John McNally wrote:
> 
> Please test patches before sending them in.  This will not compile.  It
> also assumes text uploads and loads the entire file into memory.  The
> write method exists in order to not do these things.

Sorry for my inattention. I promise the next patch(es) will be of higher
quality.

> But thanks for the idea, I have added related code to the version of
> DefaultFileItem I am working on.
> 
> john mcnally

Bartek Walter


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: [PATCH Fulcrum 1.0b] DefaultFileItem.java

Posted by John McNally <jm...@collab.net>.
Please test patches before sending them in.  This will not compile.  It
also assumes text uploads and loads the entire file into memory.  The
write method exists in order to not do these things.

But thanks for the idea, I have added related code to the version of
DefaultFileItem I am working on.

john mcnally

Bartek Walter wrote:
> 
> This simple patch was already sent packaged for Turbine 2.2 services,
> now it is repackaged for Fulcrum:
> 
> - o.a.f.services.upload.DefaultFileItem.java: it tries to do a raw copy
> if File.renameTo fails (in case the temporary storage directory for JVM
> and the file target directory are on different volumes).
> 
> The second patch I sent (for TurbineVelocityService.java - setting
> non-default encoding and charset when merging template with context) is
> no longer needed for Fulcrum, it has already been fixed.
> 
> Sorry for re-sending the patch so late, I was off for a few days.
> 
> Regards,
> Bartek
> 
>   ------------------------------------------------------------------------
> Index: DefaultFileItem.java
> ===================================================================
> RCS file: /home/cvspublic/jakarta-turbine-fulcrum/src/services/org/apache/fulcrum/upload/DefaultFileItem.java,v
> retrieving revision 1.5
> diff -r1.5 DefaultFileItem.java
> 438,439c438,448
> <                 throw new Exception(
> <                     "Cannot write uploaded file to disk!");
> ---
> >                 FileWriter writer
> >                 try
> >                 {
> >                     writer = new FileWriter(file);
> >                     writer.write(getString());
> >                 }
> >                 finally
> >                 {
> >                     if (writer != null)
> >                         writer.close();
> >                 }
> 
>   ------------------------------------------------------------------------
> --
> To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
> For additional commands, e-mail: <ma...@jakarta.apache.org>

--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>