This week's book giveaway is in the Jython/Python forum.
We're giving away four copies of Murach's Python Programming and have Michael Urban and Joel Murach on-line!
See this thread for details.
Win a copy of Murach's Python Programming this week in the Jython/Python forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

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

 
Deepak Kumar
Ranch Hand
Posts: 62
  • 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: 2907
1
Java Spring Ubuntu
  • 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
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks very much Sagar Rohankar.
 
Sagar Rohankar
Ranch Hand
Posts: 2907
1
Java Spring Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hey , has that really help you ?
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!