Class PathCommandHandler
java.lang.Object
org.exoplatform.documents.storage.jcr.webdav.plugin.PathCommandHandler
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final Stringprotected org.exoplatform.social.core.manager.IdentityManagerprotected static final org.exoplatform.services.log.Logprotected org.exoplatform.services.jcr.ext.hierarchy.NodeHierarchyCreatorstatic final Stringprotected org.exoplatform.services.jcr.RepositoryServicestatic final Stringprotected org.exoplatform.services.jcr.ext.app.SessionProviderServiceprotected org.exoplatform.social.core.space.spi.SpaceServiceprotected WebDavPathMappingStorage -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionallocateTechnicalName(javax.jcr.Session session, String parentJcrPath, String visibleName) voiddeleteMapping(String jcrPath) getIdentityBaseFromJcrPath(String jcrPath, String username) getIdentityBaseJcrPath(long identityId) getIdentityBaseJcrPath(String webDavPath) getIdentityIdFromJcrPath(String jcrPath, String username) getIdentityIdFromWebDavPath(String webDavPath) static StringgetIdentitySegmentName(org.exoplatform.social.core.identity.model.Identity identity) Returns the name an identity contributes to its WebDAV drive segment: a Space is addressed by its pretty name, the very name its drive is created under in JCR (/groups/spaces/<prettyName>/Documents): URL-safe by construction and frozen at creation, unlike the Space display name, which a rename can change and which may carry a '/'; a personal drive keeps the user full name, which reads far better than a username when the drive is mounted, and whichtoWebDavSegment(String)keeps inside a single path segment.getLastVisibleSegment(String webDavPath) getNodePathFromPropertyPath(String propertyPath) getOrCreateWebDavPath(String identityId, String identityBaseJcrPath, String identityRootWebDavPath, javax.jcr.Node node, String preferredVisibleName) getOrCreateWebDavPath(javax.jcr.Node node) getParentVisibleNodeName(javax.jcr.Node node) getVisibleName(javax.jcr.Node node) voidinit()booleanisIdentityRootWebDavPath(String webDavPath) booleanisTitlePropertyPath(String eventPath) voidrefreshMappingOrDelete(javax.jcr.Session session, String jcrPath) resolveToJcrPath(javax.jcr.Session session, String webDavPath) saveMapping(javax.jcr.Session session, String webDavPath, String visibleName, javax.jcr.Node node) static StringtoWebDavSegment(String segmentName) Last-resort guard keeping a drive name inside a single WebDAV path segment.
-
Field Details
-
PROPERTY_NAMES
-
IDENTITY_PATHS_FORMAT
- See Also:
-
PATHS_CONCAT_FORMAT
- See Also:
-
SEGMENT_CHAR_REPLACEMENT
- See Also:
-
LOG
protected static final org.exoplatform.services.log.Log LOG -
identityManager
@Autowired protected org.exoplatform.social.core.manager.IdentityManager identityManager -
spaceService
@Autowired protected org.exoplatform.social.core.space.spi.SpaceService spaceService -
nodeHierarchyCreator
@Autowired protected org.exoplatform.services.jcr.ext.hierarchy.NodeHierarchyCreator nodeHierarchyCreator -
sessionProviderService
@Autowired protected org.exoplatform.services.jcr.ext.app.SessionProviderService sessionProviderService -
repositoryService
@Autowired protected org.exoplatform.services.jcr.RepositoryService repositoryService -
webDavPathMappingStorage
-
-
Constructor Details
-
PathCommandHandler
public PathCommandHandler()
-
-
Method Details
-
init
@PostConstruct public void init() -
toWebDavSegment
Last-resort guard keeping a drive name inside a single WebDAV path segment. The names fed to it — a Space pretty name, a username — are already URL-safe by construction (seegetIdentitySegmentName(Identity)); this only makes sure an identity store that yields something unexpected cannot emit a '%2F', which is rejected before the request reaches any handler and which, once decoded, would split the drive into two segments so that the identity id can no longer be read back from the path.- Parameters:
segmentName- drive name, may be null- Returns:
- the name with every character unusable in a path segment replaced
by
SEGMENT_CHAR_REPLACEMENT
-
getIdentityBaseJcrPath
-
getIdentityBaseFromJcrPath
-
getIdentityBaseJcrPath
-
getIdentityIdFromJcrPath
-
getIdentityIdFromWebDavPath
-
resolveToJcrPath
public String resolveToJcrPath(javax.jcr.Session session, String webDavPath) throws org.exoplatform.documents.webdav.model.WebDavException - Throws:
org.exoplatform.documents.webdav.model.WebDavException
-
getLastVisibleSegment
-
isIdentityRootWebDavPath
-
getOrCreateWebDavPath
-
getOrCreateWebDavPath
-
getVisibleName
- Throws:
javax.jcr.RepositoryException
-
getParentVisibleNodeName
- Throws:
javax.jcr.RepositoryException
-
allocateTechnicalName
-
saveMapping
public WebDavPathMappingEntity saveMapping(javax.jcr.Session session, String webDavPath, String visibleName, javax.jcr.Node node) -
deleteMapping
-
refreshMappingOrDelete
-
isTitlePropertyPath
-
getNodePathFromPropertyPath
-
getIdentitySegmentName
public static String getIdentitySegmentName(org.exoplatform.social.core.identity.model.Identity identity) Returns the name an identity contributes to its WebDAV drive segment:- a Space is addressed by its pretty name, the very name its drive
is created under in JCR
(
/groups/spaces/<prettyName>/Documents): URL-safe by construction and frozen at creation, unlike the Space display name, which a rename can change and which may carry a '/'; - a personal drive keeps the user full name, which reads far better
than a username when the drive is mounted, and which
toWebDavSegment(String)keeps inside a single path segment.
- Parameters:
identity-Identityof the drive owner, may be null- Returns:
- the name the drive is addressed by, never null
- a Space is addressed by its pretty name, the very name its drive
is created under in JCR
(
-