Win a copy of The Way of the Web Tester: A Beginner's Guide to Automating Tests this week in the Testing forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Spring FileCopyUtils.copy coverts whitespaces to underscore

Anirudh Bhatnagr
Posts: 12
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

I have wriiten a file upload/download utility using Spring.
The issue I am facing is with FileCopyUtils.copy function,
If I pass a file name with white spaces FileCopyUtils.copy coverts them to underscore.
For example if filename is "hello world.txt"
It would be downloaded as "hello_world.txt"
All though I am putting quotes but still not able to get the desried filename.
Is this a limitation?
Following is the code:

Any help or pointers is appreciated.

  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic