File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

How to Convert a java.io.File to struts FormFile?

 
Deepak Kumar
Ranch Hand
Posts: 62
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi All,

I have a method XYZ(org.apache.struts.upload.FormFile file) and a method ABC(java.io.File f).
I want to convert file of type java.io.File into struts FormFile, so that I can invoke the method XYZ(FormFile file) within the method ABC(java.io.File f).

Please help me.

Thanks & Regards,
Deepak
 
Sagar Rohankar
Ranch Hand
Posts: 2904
1
Java Spring Ubuntu
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Deepak Kumar:
Hi All,


I want to convert file of type java.io.File into struts FormFile, so that I can invoke the method XYZ(FormFile file) within the method ABC(java.io.File f).



You cant convert the io.File object to that of type Struts FormFile, because they altogether two different things, there is no relation between them ,,

Can you modify your existing method parameters , like you can take another parameter of Struts FormFile in ABC method, as

 
Deepak Kumar
Ranch Hand
Posts: 62
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks very much Sagar Rohankar.
 
Sagar Rohankar
Ranch Hand
Posts: 2904
1
Java Spring Ubuntu
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hey , has that really help you ?
 
Consider Paul's rocket mass heater.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic