Package org.exoplatform.webconferencing
Class Utils
java.lang.Object
org.exoplatform.webconferencing.Utils
Created by The eXo Platform SAS.
- Version:
- $Id: Utils.java 00000 Mar 30, 2017 pnedonosko $
- Author:
- Peter Nedonosko
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic StringFormat specified object to JSON string.static StringBuild 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.getResourceMessages(String bundleName, Locale locale) Gets the resource messages.static org.exoplatform.social.core.space.model.SpaceGets the space by context.static StringGets 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.
-
Constructor Details
-
Utils
public Utils()
-
-
Method Details
-
spaceRoomName
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
Gets the space name by context.- Returns:
- the space name in portal context
-
getCurrentContext
Gets the current context.- Parameters:
userId- the user idlocale- the locale- Returns:
- the current context
-
getResourceMessages
Gets the resource messages.- Parameters:
bundleName- the bundle namelocale- the locale- Returns:
- the resource messages
-
getResourceMessage
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
Parses the date from a ISO-8601 formatted string.- Parameters:
date- the date- Returns:
- the date
- Throws:
ParseException- the parse exception
-
formatISODate
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
-