/**
* @see 移动图片
* @param fileName原始图片路径
* @param newFileName新图片路径
*/
public static Boolean copyFile(String fileName, String newFileName) {
String newflie = newFileName.substring(0, newFileName.lastIndexOf("/"));
File dirFile = null;
try {
dirFile = new File(newflie);
if (!(dirFile.exists()) && !(dirFile.isDirectory())) {
boolean creadok = dirFile.mkdirs();
if (creadok) {
System.out.println( " ok:创建文件夹成功! " );
} else {
System.out.println( " err:创建文件夹失败! " );
}
}
File source = new File(fileName);
File dest = new File(newFileName);
source.renameTo(dest);
} catch (Exception e) {
e.printStackTrace();
System.out.println(e);
}
return false;
}