public static String detectLineSeparator()

in src/main/java/org/apache/maven/buildcache/checksum/DigestUtils.java [156:167]


    public static String detectLineSeparator(CharSequence text) {
        // first line break only
        int index = StringUtils.indexOfAny(text, "\n\r");
        if (index == -1 || index >= text.length()) {
            return null;
        }
        char ch = text.charAt(index);
        if (ch == '\r') {
            return index + 1 < text.length() && text.charAt(index + 1) == '\n' ? "CRLF" : "CR";
        }
        return ch == '\n' ? "LF" : null;
    }