private void collectFiles(String path, File... files) {
        for (File file : files) {
            if (!file.canRead()) {
                logger.warn("Can't read from file %:", file.getAbsolutePath());
                continue;
            }
            UpdateItem ui = new UpdateItem();
            ui.setNewData(true);
            ui.setIsAnti(false);
            ui.setSize(0);
            ui.setmTime(file.lastModified());
            ui.setmTimeDefined(file.lastModified() != 0L);
            ui.setmTimeDefined(true);
            String childName;
            if (!path.isEmpty()) {
                childName = path + File.separator + file.getName();
            } else {
                childName = file.getName();
            }
            ui.setName(childName);
            ui.setFullName(file.getAbsolutePath());
            ui.setIsDir(file.isDirectory());
            ui.setIsAnti(false);
            ui.setSize(file.length());
            if (file.isDirectory())
                ui.setAttrib(16);
            else
                ui.setAttrib(32);
            ui.setAttribDefined(true);
            updateItems.add(ui);
            if (file.isDirectory()) {
                collectFiles(childName, file.listFiles());
            }
        }
    }