Package org.webswing.server.util
Class ServerUtil
- java.lang.Object
-
- org.webswing.server.util.ServerUtil
-
public class ServerUtil extends Object
-
-
Constructor Summary
Constructors Constructor Description ServerUtil()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static ObjectdecodeJson(String s)static org.webswing.model.s2c.AppFrameMsgOutdecodePlaybackProto(byte[] message)static ObjectdecodeProto(byte[] message)static StringdomainFromUrl(String fullUrl)static Stringencode2Json(org.webswing.model.MsgOut m)static byte[]encode2Proto(org.webswing.model.MsgOut m)static StringgenerateInstanceId(WebSocketConnection r, org.webswing.model.c2s.ConnectionHandshakeMsgIn h, String appPath)static StringgetClientBrowser(WebSocketConnection r)static StringgetClientOs(WebSocketConnection r)static StringgetContextPath(javax.servlet.ServletContext ctx)static StringgetCustomArgs(javax.servlet.http.HttpServletRequest r)static intgetDebugPort(javax.servlet.http.HttpServletRequest r)static URLgetFileResource(String resource, File folder)static URLgetWebResource(String resource, javax.servlet.ServletContext servletContext, File webFolder)static booleanisAdminUrlSameOrigin(String adminUrl, String url)static booleanisFileLocked(File file)static booleanisRecording(javax.servlet.http.HttpServletRequest r)static StringresolveOwnerIdForSessionMode(WebSocketConnection r, org.webswing.model.c2s.ConnectionHandshakeMsgIn h, org.webswing.server.common.model.SwingConfig conf)static voidsendHttpRedirect(javax.servlet.http.HttpServletRequest req, javax.servlet.http.HttpServletResponse resp, String relativeUrl)
-
-
-
Method Detail
-
encode2Json
public static String encode2Json(org.webswing.model.MsgOut m)
-
encode2Proto
public static byte[] encode2Proto(org.webswing.model.MsgOut m)
-
decodeProto
public static Object decodeProto(byte[] message)
-
decodePlaybackProto
public static org.webswing.model.s2c.AppFrameMsgOut decodePlaybackProto(byte[] message)
-
getClientOs
public static String getClientOs(WebSocketConnection r)
-
getClientBrowser
public static String getClientBrowser(WebSocketConnection r)
-
resolveOwnerIdForSessionMode
public static String resolveOwnerIdForSessionMode(WebSocketConnection r, org.webswing.model.c2s.ConnectionHandshakeMsgIn h, org.webswing.server.common.model.SwingConfig conf)
-
generateInstanceId
public static String generateInstanceId(WebSocketConnection r, org.webswing.model.c2s.ConnectionHandshakeMsgIn h, String appPath)
-
isRecording
public static boolean isRecording(javax.servlet.http.HttpServletRequest r)
-
getCustomArgs
public static String getCustomArgs(javax.servlet.http.HttpServletRequest r)
-
getDebugPort
public static int getDebugPort(javax.servlet.http.HttpServletRequest r)
-
getWebResource
public static URL getWebResource(String resource, javax.servlet.ServletContext servletContext, File webFolder)
-
isFileLocked
public static boolean isFileLocked(File file)
-
getContextPath
public static String getContextPath(javax.servlet.ServletContext ctx)
-
sendHttpRedirect
public static void sendHttpRedirect(javax.servlet.http.HttpServletRequest req, javax.servlet.http.HttpServletResponse resp, String relativeUrl) throws IOException- Throws:
IOException
-
-