Class StudioUtils
java.lang.Object
org.craftercms.studio.api.v2.utils.StudioUtils
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic StringgetMimeType(String filename) static StringgetSandboxRepoLockKey(String siteId) Get the key for sandbox repo operations lockstatic StringObtains the siteId from the current request, always fails if called out of a request contextstatic Pathstatic StringgetSyncFromRepoLockKey(String siteId) Get the key for sync-from-repo task lockstatic StringgetTopLevelFolder(String path) Gets the top level folder wherepathis contained.static booleanmatchesPatterns(String path, List<String> patterns)
-
Constructor Details
-
StudioUtils
public StudioUtils()
-
-
Method Details
-
getMimeType
-
getSiteId
Obtains the siteId from the current request, always fails if called out of a request context- Returns:
- the siteId
-
matchesPatterns
-
getTopLevelFolder
Gets the top level folder wherepathis 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
-
getStudioTemporaryFilesRoot
-
getSandboxRepoLockKey
Get the key for sandbox repo operations lock- Parameters:
siteId- the site id- Returns:
- the lock key
-
getSyncFromRepoLockKey
Get the key for sync-from-repo task lock- Parameters:
siteId- the site id- Returns:
- the lock key
-