-2

Possible Duplicate:
Renaming a file using Java

renameFile: This method should take as input a String from and a String to. It should return a boolean. The method should find the index in drive of a file with name from. If no such index exists, the method should return false. It should also check that the file to does not exist. If the file to does exist, then the method should return false. If the file from exists and to does not, then the method should change the name of the file from from to be to. In this case, the method should return true

can someone show me how to do this?

Community
  • 1
  • 1

1 Answers1

0

Starting here you should be able to figure it out.

Andrew Thompson
  • 168,117
  • 40
  • 217
  • 433
Sibbo
  • 3,796
  • 2
  • 23
  • 41
  • because I'm writing this in java – slidepuppy1 Oct 30 '11 at 18:33
  • The link goes to Java 7, but the File class was specified since Java 1.0. Maybe this http://download.oracle.com/javase/7/docs/api/java/io/File.html#renameTo%28java.io.File%29 makes it easier for you. – Sibbo Oct 30 '11 at 18:34