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:   <mailto:[EMAIL PROTECTED]>
> For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>

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

Reply via email to