• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
  • Campbell Ritchie
  • Ron McLeod
  • Paul Clapham
  • Bear Bibeault
  • Junilu Lacar
  • Jeanne Boyarsky
  • Tim Cooke
  • Henry Wong
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • salvin francis
  • Frits Walraven
  • Scott Selikoff
  • Piet Souris
  • Carey Brown

How to instantiate a new FormFile object

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/vnd.ms-excel,text/xml",true,
"myfileName",1200, null);
CommonsMultipartRequestHandler mp = new CommonsMultipartRequestHandler();
CommonsMultipartRequestHandler.CommonsFormFile dd = mp.new 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?

when your children are suffering from your punishment, tell your them it will help them write good poetry when they are older. Like this tiny ad:
Thread Boost feature
    Bookmark Topic Watch Topic
  • New Topic