private static AbstractDiffResult createDiffResult(DiffFolderResult parent,
File oldFile, File newFile, String charset, DiffStatus status) {
if (newFile != null && newFile.isFile()) {
DiffFileResult diffResult;
Cutter cutter = CutterFactory.getCutter(newFile);
if (cutter != null) {
diffResult = createDiffFileResult(parent, oldFile, newFile,
charset, status, cutter);
} else {
// �J�b�^�[���擾�ł��Ȃ������ꍇ�̓T�|�[�g�ΏۊO�Ƃ���
diffResult = new DiffFileResult(parent);
diffResult.setName(newFile.getName());
diffResult.setStatus(DiffStatus.UNSUPPORTED);
diffResult.setAddCount(0);
diffResult.setFileType(CutterFactory.getFileType(newFile));
}
return diffResult;
} else if (oldFile != null && oldFile.isFile()) {
DiffFileResult diffResult = new DiffFileResult(parent);
diffResult.setName(oldFile.getName());
diffResult.setStatus(status);
diffResult.setFileType(CutterFactory.getFileType(oldFile));
Cutter cutter = CutterFactory.getCutter(oldFile);
if (cutter != null && status == DiffStatus.REMOVED) {
// �폜�t�@�C���̏ꍇ
DiffSource source = cutter.cut(DiffCounterUtil.getSource(
oldFile, charset));
if (source.isIgnore()) {
return null;
}
diffResult.setDelCount(DiffCounterUtil.split(source.getSource()).length);
diffResult.setCategory(source.getCategory());
}
return diffResult;
} else if (newFile != null && newFile.isDirectory()) {
DiffFolderResult diffResult = new DiffFolderResult(parent);
diffResult.setName(newFile.getName());
diffResult.setStatus(status);
return diffResult;
} else if (oldFile != null && oldFile.isDirectory()) {
DiffFolderResult diffResult = new DiffFolderResult(parent);
diffResult.setName(oldFile.getName());
diffResult.setStatus(status);
return diffResult;
}
return null;
}