424734 - WebSocket / Expose Locale information from ServletUpgradeRequest

This commit is contained in:
Joakim Erdfelt 2013-12-29 17:05:41 -07:00
parent ec9d807a47
commit 118fc97fe1
1 changed files with 21 additions and 0 deletions

View File

@ -29,6 +29,7 @@ import java.util.Collections;
import java.util.Enumeration;
import java.util.HashMap;
import java.util.List;
import java.util.Locale;
import java.util.Map;
import javax.servlet.http.Cookie;
@ -141,6 +142,26 @@ public class ServletUpgradeRequest extends UpgradeRequest
{
return req.getLocalPort();
}
/**
* Equivalent to {@link HttpServletRequest#getLocale()}
*
* @return the preferred <code>Locale</code> for the client
*/
public Locale getLocale()
{
return req.getLocale();
}
/**
* Equivalent to {@link HttpServletRequest#getLocales()}
*
* @return an Enumeration of preferred Locale objects
*/
public Enumeration<Locale> getLocales()
{
return req.getLocales();
}
/**
* Return a {@link InetSocketAddress} for the local socket.