Package org.exoplatform.webconferencing
Class Utils
- java.lang.Object
-
- org.exoplatform.webconferencing.Utils
-
public class Utils extends Object
Created by The eXo Platform SAS.- Version:
- $Id: Utils.java 00000 Mar 30, 2017 pnedonosko $
- Author:
- Peter Nedonosko
-
-
Constructor Summary
Constructors Constructor Description Utils()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static StringasJSON(Object obj)Format specified object to JSON string.static StringbuildUrl(String protocol, String hostname, int port, String path)Build client URL using given parameters.static StringformatISODate(Date date)Format date as ISO-8601 string with UTC time zone.static ContextInfogetCurrentContext(String userId, Locale locale)Gets the current context.static StringgetResourceMessage(String bundleName, Locale locale, String messageKey)Gets the resource message.static Map<String,String>getResourceMessages(String bundleName, Locale locale)Gets the resource messages.static org.exoplatform.social.core.space.model.SpacegetSpaceByContext()Gets the space by context.static StringgetSpaceNameByContext()Gets the space name by context.static DateparseISODate(String date)Parses the date from a ISO-8601 formatted string.static StringspaceRoomName(String spacePrettyName)Generate a space room name.
-
-
-
Method Detail
-
spaceRoomName
public static String spaceRoomName(String spacePrettyName)
Generate a space room name.- Parameters:
spacePrettyName- the space pretty name- Returns:
- the string
-
getSpaceByContext
public static org.exoplatform.social.core.space.model.Space getSpaceByContext()
Gets the space by context.- Returns:
- the space by context
-
getSpaceNameByContext
public static String getSpaceNameByContext()
Gets the space name by context.- Returns:
- the space name in portal context
-
getCurrentContext
public static ContextInfo getCurrentContext(String userId, Locale locale)
Gets the current context.- Parameters:
userId- the user idlocale- the locale- Returns:
- the current context
-
getResourceMessages
public static Map<String,String> getResourceMessages(String bundleName, Locale locale)
Gets the resource messages.- Parameters:
bundleName- the bundle namelocale- the locale- Returns:
- the resource messages
-
getResourceMessage
public static String getResourceMessage(String bundleName, Locale locale, String messageKey)
Gets the resource message.- Parameters:
bundleName- the bundle namelocale- the localemessageKey- the message key- Returns:
- the resource message
-
asJSON
public static String asJSON(Object obj) throws org.exoplatform.ws.frameworks.json.impl.JsonException
Format specified object to JSON string.- Parameters:
obj- the obj- Returns:
- the string
- Throws:
org.exoplatform.ws.frameworks.json.impl.JsonException- the json exception
-
parseISODate
public static Date parseISODate(String date) throws ParseException
Parses the date from a ISO-8601 formatted string.- Parameters:
date- the date- Returns:
- the date
- Throws:
ParseException- the parse exception
-
formatISODate
public static String formatISODate(Date date)
Format date as ISO-8601 string with UTC time zone.- Parameters:
date- the date- Returns:
- the string
-
buildUrl
public static String buildUrl(String protocol, String hostname, int port, String path) throws MalformedURLException
Build client URL using given parameters.- Parameters:
protocol- the schemehostname- the host nameport- the portpath- the path- Returns:
- the string
- Throws:
MalformedURLException- if the protocol hasn't a handled
-
-