Only 48 hours left in the trailboss' kickstarter!

New rewards and stretch goals. CLICK HERE!



  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Rename The File  RSS feed

 
naval kumar
Ranch Hand
Posts: 38
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Dear Sir,
I have To rename the File 123.pdf with The 123_userId.pdf.

I have seen the code



But I want To Rename the File With the Existing Name+"-"+DynamicUserID.pdf ( Example 123.pdf with 123_5122.pdf)
 
Stuart A. Burkett
Ranch Hand
Posts: 679
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
naval kumar wrote:But I want To Rename the File With the Existing Name+"-"+DynamicUserID.pdf ( Example 123.pdf with 123_5122.pdf)

So what problems are you having ? You will find suitable methods for doing what you want in the File and String classes.
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!