Class StudioUtils
- java.lang.Object
-
- org.craftercms.studio.api.v2.utils.StudioUtils
-
public abstract class StudioUtils extends Object
-
-
Constructor Summary
Constructors Constructor Description StudioUtils()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static String
getMimeType(String filename)
static String
getSiteId()
Obtains the siteId from the current request, always fails if called out of a request contextstatic String
getTopLevelFolder(String path)
Gets the top level folder wherepath
is contained.static boolean
matchesPatterns(String path, List<String> patterns)
-
-
-
Method Detail
-
getSiteId
public static String getSiteId()
Obtains the siteId from the current request, always fails if called out of a request context- Returns:
- the siteId
-
getTopLevelFolder
public static String getTopLevelFolder(String path)
Gets the top level folder wherepath
is contained. The result will be a value from the list defined at StudioConstants.TOP_LEVEL_FOLDERS, if found, null otherwise.- Parameters:
path
- the content path- Returns:
- top level root path, if matched, or null otherwise
-
-