view src/org/eclipse/jetty/http/HttpHeaderValues.java @ 1075:ebb0f1343ef6

remove JBuffer
author Franklin Schmidt <fschmidt@gmail.com>
date Thu, 10 Nov 2016 03:08:20 -0700
parents 3718afd99988
children
line wrap: on
line source

//
//  ========================================================================
//  Copyright (c) 1995-2014 Mort Bay Consulting Pty. Ltd.
//  ------------------------------------------------------------------------
//  All rights reserved. This program and the accompanying materials
//  are made available under the terms of the Eclipse Public License v1.0
//  and Apache License v2.0 which accompanies this distribution.
//
//      The Eclipse Public License is available at
//      http://www.eclipse.org/legal/epl-v10.html
//
//      The Apache License v2.0 is available at
//      http://www.opensource.org/licenses/apache2.0.php
//
//  You may elect to redistribute this code under either of these licenses.
//  ========================================================================
//

package org.eclipse.jetty.http;

import org.eclipse.jetty.io.StringCache;

/**
 * Cached HTTP Header values.
 * The resource "/org/eclipse/jetty/useragents" is checked for a list of common user agents, so that repeated
 * creation of strings for these agents can be avoided.
 * 
 * 
 */
public final class HttpHeaderValues
{
	public final static String
		CLOSE="close",
		CHUNKED="chunked",
		GZIP="gzip",
		IDENTITY="identity",
		KEEP_ALIVE="keep-alive",
		CONTINUE="100-continue",
		PROCESSING="102-processing",
		TE="TE",
		BYTES="bytes",
		NO_CACHE="no-cache",
		UPGRADE="Upgrade";

	public final static int
		CLOSE_ORDINAL=1,
		CHUNKED_ORDINAL=2,
		GZIP_ORDINAL=3,
		IDENTITY_ORDINAL=4,
		KEEP_ALIVE_ORDINAL=5,
		CONTINUE_ORDINAL=6,
		PROCESSING_ORDINAL=7,
		TE_ORDINAL=8,
		BYTES_ORDINAL=9,
		NO_CACHE_ORDINAL=10,
		UPGRADE_ORDINAL=11;
	
    public final static StringCache CACHE = new StringCache();

	public final static byte[] 
		CLOSE_BYTES=CACHE.add(CLOSE,CLOSE_ORDINAL),
		CHUNKED_BYTES=CACHE.add(CHUNKED,CHUNKED_ORDINAL),
		GZIP_BYTES=CACHE.add(GZIP,GZIP_ORDINAL),
		IDENTITY_BYTES=CACHE.add(IDENTITY,IDENTITY_ORDINAL),
		KEEP_ALIVE_BYTES=CACHE.add(KEEP_ALIVE,KEEP_ALIVE_ORDINAL),
		CONTINUE_BYTES=CACHE.add(CONTINUE, CONTINUE_ORDINAL),
		PROCESSING_BYTES=CACHE.add(PROCESSING, PROCESSING_ORDINAL),
		TE_BYTES=CACHE.add(TE,TE_ORDINAL),
		BYTES_BYTES=CACHE.add(BYTES,BYTES_ORDINAL),
		NO_CACHE_BYTES=CACHE.add(NO_CACHE,NO_CACHE_ORDINAL),
		UPGRADE_BYTES=CACHE.add(UPGRADE,UPGRADE_ORDINAL);
		
}