AbuMariam
AbuMariam

Reputation: 3678

Convert text file to DataHandler

I have a text file that I need to send as part of a SOAP request over web service.

Could someone please share the code of getting this text file into a Data Handler (in java)? I know it probably involves streams not sure of the exact code.

Upvotes: 5

Views: 8426

Answers (1)

AbuMariam
AbuMariam

Reputation: 3678

I think I figured it out..

 DataSource fds = new FileDataSource("C:/DBMigrations/Sample_Upload_Tasks.txt");
 DataHandler handler = new DataHandler(fds);

Just create a file data source and give it the file and create a handler based on that data source.

Upvotes: 8

Related Questions