private static String extractEntityTag(String value) {
        int i = 0;
        int etagStart = -1;
        int etagEnd = -1;
        for (; i < value.length(); i++) {
            if (value.charAt(i) == '\"') {
                etagStart = i + 1;
                i++;
                break;
            }
        }

        if (etagStart < 0) {
            // Not surrounded by double quotes.
            return value;
        }

        for (; i < value.length(); i++) {
            if (value.charAt(i) == '\"') {
                etagEnd = i;
                break;
            }
        }

        return etagEnd > 0 ? value.substring(etagStart, etagEnd) : value.substring(etagStart);
    }
Returns a new {@link HttpResponse} which streams the content of the file which follows the specified
{@link ResponseHeaders}.

@param headers the {@link ResponseHeaders}
@param length the content length. The returned {@link HttpResponse} must stream only as many bytes as
              this value.
@param fileReadExecutor the {@link Executor} which should be used for performing a blocking file I/O
@param alloc the {@link ByteBufAllocator} which should be used for allocating an input buffer

@return the {@link HttpResponse}, or {@code null} if the file does not exist.
@throws IOException if failed to open the file. Note that an I/O error which occurred during content
                    streaming will be notified via the returned {@link HttpResponse}'s error
                    notification mechanism.
core/src/main/java/com/linecorp/armeria/server/file/AbstractHttpFile.java