问题描述
Linux 系统原文件所属user1, 使用user2 在move到另一个文件下后,新的文件夹下有一个文件所属为user2. 其它的都是user1.
moveFile通过org.apache.commons.io.FileUtils.moveFile();
权限没有问题,为什么移动后的文件所属不一致呢?
查看原码
public static void moveFile(File srcFile, File destFile) throws IOException {
if (srcFile == null) {
throw new NullPointerException("Source must not be null");
} else if (destFile == null) {
throw new NullPointerException("Destination must not be null");
} else if (!srcFile.exists()) {
throw new FileNotFoundException("Source '" + srcFile + "' does not exist");
} else if (srcFile.isDirectory()) {
throw new IOException("Source '" + srcFile + "' is a directory");
} else if (destFile.exists()) {
throw new FileExistsException("Destination '