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

deleting file from folder if exists and create new file  RSS feed

 
dasari sudha
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello

I have uploaded adocument using upload bean which was supplied by javazoom, but when i upload a same document again it is creating a file with some number. How to check whether the file exists in the folder or not and if exists delete the file and create a new file .

thanks in advance
 
Jeroen Wenting
Ranch Hand
Posts: 5093
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Read the API docs for File and use your imagination. Everything you need is right there.
 
dasari sudha
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thank you Jeroen Wenting
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!