Package org.duracloud.duradmin.util
Class SpaceUtil
- java.lang.Object
-
- org.duracloud.duradmin.util.SpaceUtil
-
public class SpaceUtil extends Object
Provides utility methods for spaces.- Author:
- Bill Branan
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static StringformatAclDisplayName(String key)protected static booleanhasRole(org.springframework.security.core.Authentication authentication, String role)static booleanisAdmin(org.springframework.security.core.Authentication authentication)protected static booleanisSnapshotProvider(ContentStore store)static voidpopulateContentItem(String duradminBaseURL, ContentItem contentItem, String spaceId, String contentId, ContentStore store, org.springframework.security.core.Authentication authentication)static SpacepopulateSpace(Space space, Space cloudSpace, ContentStore contentStore, org.springframework.security.core.Authentication authentication)static AclTyperesolveCallerAcl(String spaceId, ContentStore store, Map<String,AclType> acls, org.springframework.security.core.Authentication authentication)static AclTyperesolveCallerAcl(String spaceId, ContentStore store, Map<String,AclType> acls, org.springframework.security.core.Authentication authentication, Boolean snapshotInProgress)static voidsortAcls(List<Acl> acls)static voidstreamContent(ContentStore store, javax.servlet.http.HttpServletResponse response, String spaceId, String contentId)static voidstreamToResponse(InputStream is, javax.servlet.http.HttpServletResponse response, String mimetype, String contentLength)static List<Acl>toAclList(Map<String,AclType> spaceACLs)
-
-
-
Method Detail
-
populateSpace
public static Space populateSpace(Space space, Space cloudSpace, ContentStore contentStore, org.springframework.security.core.Authentication authentication) throws ContentStoreException
- Throws:
ContentStoreException
-
populateContentItem
public static void populateContentItem(String duradminBaseURL, ContentItem contentItem, String spaceId, String contentId, ContentStore store, org.springframework.security.core.Authentication authentication) throws ContentStoreException
- Throws:
ContentStoreException
-
streamContent
public static void streamContent(ContentStore store, javax.servlet.http.HttpServletResponse response, String spaceId, String contentId) throws ContentStoreException, IOException
- Throws:
ContentStoreExceptionIOException
-
streamToResponse
public static void streamToResponse(InputStream is, javax.servlet.http.HttpServletResponse response, String mimetype, String contentLength) throws ContentStoreException, IOException
- Throws:
ContentStoreExceptionIOException
-
resolveCallerAcl
public static AclType resolveCallerAcl(String spaceId, ContentStore store, Map<String,AclType> acls, org.springframework.security.core.Authentication authentication) throws ContentStoreException
- Throws:
ContentStoreException
-
resolveCallerAcl
public static AclType resolveCallerAcl(String spaceId, ContentStore store, Map<String,AclType> acls, org.springframework.security.core.Authentication authentication, Boolean snapshotInProgress) throws ContentStoreException
- Throws:
ContentStoreException
-
isSnapshotProvider
protected static boolean isSnapshotProvider(ContentStore store)
-
isAdmin
public static boolean isAdmin(org.springframework.security.core.Authentication authentication)
-
hasRole
protected static boolean hasRole(org.springframework.security.core.Authentication authentication, String role)
-
-