private ActivityLog getActivityLog(File file) {

        // Verify file can actually be read
        if (!file.canRead()) {
            logger.warn("Ignoring file \"{}\" relevant to connection history "
                    + "record as it cannot be read.", file);
            return null;
        }

        // Determine type of recording/log by inspecting file
        ActivityLog.Type logType = getType(file);
        if (logType == null) {
            logger.warn("Recording/log type of \"{}\" cannot be determined.", file);
            return null;
        }

        return new FileActivityLog(
            logType,
            new TranslatableMessage("RECORDING_STORAGE.INFO_" + logType.name()),
            file
        );

    }
Returns a new ActivityLog instance representing the session recording or
log contained within the given file. If the type of recording/log cannot
be determined, or if the file is unreadable, null is returned.

@param file
    The file to produce an ActivityLog instance for.

@return
    A new ActivityLog instance representing the recording/log contained
    within the given file, or null if the file is unreadable or cannot
    be identified.
extensions/guacamole-history-recording-storage/src/main/java/org/apache/guacamole/history/connection/HistoryConnectionRecord.java