Win a copy of Kotlin in Action this week in the Kotlin forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

How to instantiate a new FormFile object  RSS feed

Medha kamat
Posts: 21
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have a form that uploads a file.Form uses FormFile object for
uploading of the file.Uploading works just fine.Problem i am having is
while wrtitng an automated test.In the test i am seting a form using setActionForm.Now as i mentioned in this form i want to set a FormFile object and that's where i am struggling

HolidayFeedUploadForm holidayFeedForm = new HolidayFeedUploadForm();
DiskFileItem fileItem = new DiskFileItem("uploadFile","application/,text/xml",true,
"myfileName",1200, null);
CommonsMultipartRequestHandler mp = new CommonsMultipartRequestHandler();
CommonsMultipartRequestHandler.CommonsFormFile dd = CommonsFormFile(fileItem);

It complains about visiblity of CommonsMultipartRequestHandler.
CommonsFormFile.I know that CommonsFormFile is an inner class and
package access is private.All i want to do is create a new FormFile
object and set it on the form.How would i achieve that?

It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!