Here you can find the source of rename(String from, String to)
Parameter | Description |
---|---|
from | a parameter |
to | a parameter |
public static boolean rename(String from, String to)
//package com.java2s; import java.io.File; public class Main { /**/* ww w . ja v a2s. c o m*/ * @param from * @param to * @return */ public static boolean rename(String from, String to) { File fFrom = new File(from); File fTo = new File(to); if (!fFrom.exists()) { return false; } else { return fFrom.renameTo(fTo); } } }