Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

re-naming a file

Posted on 2013-11-08
2
Medium Priority
?
114 Views
Last Modified: 2013-11-14
hi guys

I want to rename a file , so the new file will have the new name and all contents from old file
Is there a simple way to do this?

is this correct?

for (final File fileEntry : folder.listFiles()) {
String newFileName = fileEntry.getName()+".RENAMED";
File newFile = new File(fileEntry.getParent(), newFileName);
}

Open in new window

0
Comment
Question by:royjayd
  • 2
2 Comments
 
LVL 86

Accepted Solution

by:
CEHJ earned 1600 total points
ID: 39633500
That's ok
0
 
LVL 86

Expert Comment

by:CEHJ
ID: 39648470
:)
0

Featured Post

Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This was posted to the Netbeans forum a Feb, 2010 and I also sent it to Verisign. Who didn't help much in my struggles to get my application signed. ------------------------- Start The idea here is to target your cell phones with the correct…
Java Flight Recorder and Java Mission Control together create a complete tool chain to continuously collect low level and detailed runtime information enabling after-the-fact incident analysis. Java Flight Recorder is a profiling and event collectio…
Viewers will learn about if statements in Java and their use The if statement: The condition required to create an if statement: Variations of if statements: An example using if statements:
This tutorial covers a practical example of lazy loading technique and early loading technique in a Singleton Design Pattern.
Suggested Courses

927 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question