是不是半角片假名
public static boolean isKatakana(byte c) {
int i = 0xff & c;
return (i > 0xa0 && i < 0xe0);
}
/**
* 移动文件夹内的全部文件到另一文件夹下
* @param fromFile 源文件夹
* @param toFile 目的文件夹
*/
public static void copyOneToAnother(File fromFile, File toFile){
if(fromFile.isDirectory()){
if (!toFile.exists()) {
toFile.mkdir();
}
String[] children = fromFile.list();
for (int i=0; i<children.length; i++) {
copyOneToAnother(new File(fromFile, children[i]),
new File(toFile, children[i]));
}
}else{
try {
FileChannel fromChannel = new FileInputStream(fromFile).getChannel();
FileChannel toChannel = new FileOutputStream(toFile).getChannel();
//移动文件
toChannel.transferFrom(fromChannel, 0, fromChannel.size());
//关闭通道
fromChannel.close();
toChannel.close();
} catch (IOException e) {
}
}
}