Solved

re-naming a file

Posted on 2013-11-08
2
98 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
2 Comments
 
LVL 86

Accepted Solution

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

Expert Comment

by:CEHJ
ID: 39648470
:)
0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
jdbc error in jsp application 20 71
jboss wildfly 10.1 10 415
Java: anonymous class 4 37
java imports not found 4 47
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…
In this post we will learn different types of Android Layout and some basics of an Android App.
Viewers will learn about arithmetic and Boolean expressions in Java and the logical operators used to create Boolean expressions. We will cover the symbols used for arithmetic expressions and define each logical operator and how to use them in Boole…
The viewer will learn how to implement Singleton Design Pattern in Java.

762 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