Class NonChannelTestFileSystemContentManager
java.lang.Object
com.aquima.interactions.test.content.NonChannelTestFileSystemContentManager
- All Implemented Interfaces:
com.aquima.interactions.portal.IContentManager
,com.aquima.interactions.portal.IMovingContentManager
public class NonChannelTestFileSystemContentManager
extends Object
implements com.aquima.interactions.portal.IContentManager
A manager of content on a file system.
Path / File name generation is delegated to an instance of IFileSystemNamingStrategy
.
This manager creates two files for snippet of content that is managed:
- a file that contains the content;
- another file that contains the meta-data related to the content. meta-data file also contains the roles acquired by the content.
This implementation does not explicitly store the file size in the metadata. Instead, whenever a metadata-representation is constructed, the instance is complemented with file size information that is obtained from the filesystem directly.
- Since:
- 9.3
- Author:
- G. der Kinderen
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic final class
Metadata representation. -
Field Summary
-
Constructor Summary
ConstructorDescriptionNonChannelTestFileSystemContentManager
(com.aquima.interactions.foundation.connectivity.impl.FileSystemConnection connection) Constructs a new manager, using a default naming strategy.NonChannelTestFileSystemContentManager
(com.aquima.interactions.foundation.connectivity.impl.FileSystemConnection connection, com.aquima.interactions.portal.content.filesystem.IFileSystemNamingStrategy namingStrategy, com.aquima.interactions.portal.content.FileRoleCache roleCache) Constructs a new manager. -
Method Summary
Modifier and TypeMethodDescriptionboolean
canMove()
com.aquima.interactions.foundation.GUID
create
(InputStream stream, String name, String contentType, Long processId, String caseId, com.aquima.interactions.portal.content.CustomContentProperties properties, com.aquima.interactions.project.IUserData user, String... roles) Deprecated.void
delete
(com.aquima.interactions.foundation.GUID id, com.aquima.interactions.project.IUserData user, boolean checkRoles) com.aquima.interactions.portal.IDisposableContent
com.aquima.interactions.portal.IMovingContentManager
boolean
boolean
isAuthorized
(com.aquima.interactions.foundation.GUID id, com.aquima.interactions.project.IUserData user) com.aquima.interactions.foundation.GUID
move
(com.aquima.interactions.foundation.GUID fileId, com.aquima.interactions.portal.IContentManager targetContentManager, com.aquima.interactions.project.IUserData user) void
notifyMove
(com.aquima.interactions.foundation.GUID id) int
readBytes
(com.aquima.interactions.foundation.GUID id, long position, byte[] buffer, int offset, int length, com.aquima.interactions.project.IUserData user) Deprecated.com.aquima.interactions.portal.IContentMetadata
readMetadata
(com.aquima.interactions.foundation.GUID id, com.aquima.interactions.project.IUserData user, boolean checkRoles) String[]
readRoles
(com.aquima.interactions.foundation.GUID id, com.aquima.interactions.project.IUserData user) protected String
toContentPath
(com.aquima.interactions.foundation.GUID guid) Calculates the file system path in which content is stored that is identified by the provided identifier.protected String
toMetadataPath
(com.aquima.interactions.foundation.GUID guid) Calculates the file system path in which metadata is stored for content identified by the provided identifier.void
update
(com.aquima.interactions.foundation.GUID id, InputStream stream, String name, String contentType, com.aquima.interactions.project.IUserData user) Deprecated.void
update
(com.aquima.interactions.foundation.GUID id, InputStream stream, String name, String contentType, Long processId, String caseId, com.aquima.interactions.portal.content.CustomContentProperties properties, com.aquima.interactions.project.IUserData user) Deprecated.void
update
(com.aquima.interactions.foundation.GUID id, Long processId, String caseId, com.aquima.interactions.portal.content.CustomContentProperties properties, com.aquima.interactions.project.IUserData user) void
update
(com.aquima.interactions.foundation.GUID id, String[] newRoles, com.aquima.interactions.project.IUserData user)
-
Field Details
-
CONTENT_PATHSEGMENT
The identifier of the path segment that is prepended to all files that contain the (raw) content.- See Also:
-
METADATA_PATHSEGMENT
The identifier of the path segment that is prepended to all files that contain metadata.- See Also:
-
-
Constructor Details
-
NonChannelTestFileSystemContentManager
public NonChannelTestFileSystemContentManager(com.aquima.interactions.foundation.connectivity.impl.FileSystemConnection connection) Constructs a new manager, using a default naming strategy.- Parameters:
connection
- The connection providing access to the content store (cannot benull
).- Since:
- 9.3
-
NonChannelTestFileSystemContentManager
public NonChannelTestFileSystemContentManager(com.aquima.interactions.foundation.connectivity.impl.FileSystemConnection connection, com.aquima.interactions.portal.content.filesystem.IFileSystemNamingStrategy namingStrategy, com.aquima.interactions.portal.content.FileRoleCache roleCache) Constructs a new manager.- Parameters:
connection
- The connection providing access to the content store (cannot benull
).namingStrategy
- a path/name converter (cannot benull
).- Since:
- 9.3
-
-
Method Details
-
create
@Deprecated public com.aquima.interactions.foundation.GUID create(InputStream stream, String name, String contentType, Long processId, String caseId, com.aquima.interactions.portal.content.CustomContentProperties properties, com.aquima.interactions.project.IUserData user, String... roles) Deprecated.- Specified by:
create
in interfacecom.aquima.interactions.portal.IContentManager
-
readMetadata
public com.aquima.interactions.portal.IContentMetadata readMetadata(com.aquima.interactions.foundation.GUID id, com.aquima.interactions.project.IUserData user, boolean checkRoles) - Specified by:
readMetadata
in interfacecom.aquima.interactions.portal.IContentManager
-
readRoles
public String[] readRoles(com.aquima.interactions.foundation.GUID id, com.aquima.interactions.project.IUserData user) - Specified by:
readRoles
in interfacecom.aquima.interactions.portal.IContentManager
-
update
public void update(com.aquima.interactions.foundation.GUID id, String[] newRoles, com.aquima.interactions.project.IUserData user) - Specified by:
update
in interfacecom.aquima.interactions.portal.IContentManager
-
update
@Deprecated public void update(com.aquima.interactions.foundation.GUID id, InputStream stream, String name, String contentType, Long processId, String caseId, com.aquima.interactions.portal.content.CustomContentProperties properties, com.aquima.interactions.project.IUserData user) Deprecated.- Specified by:
update
in interfacecom.aquima.interactions.portal.IContentManager
-
update
@Deprecated public void update(com.aquima.interactions.foundation.GUID id, InputStream stream, String name, String contentType, com.aquima.interactions.project.IUserData user) Deprecated.- Specified by:
update
in interfacecom.aquima.interactions.portal.IContentManager
-
update
public void update(com.aquima.interactions.foundation.GUID id, Long processId, String caseId, com.aquima.interactions.portal.content.CustomContentProperties properties, com.aquima.interactions.project.IUserData user) - Specified by:
update
in interfacecom.aquima.interactions.portal.IContentManager
-
getImplementation
public com.aquima.interactions.portal.IMovingContentManager getImplementation()- Specified by:
getImplementation
in interfacecom.aquima.interactions.portal.IMovingContentManager
-
move
public com.aquima.interactions.foundation.GUID move(com.aquima.interactions.foundation.GUID fileId, com.aquima.interactions.portal.IContentManager targetContentManager, com.aquima.interactions.project.IUserData user) - Specified by:
move
in interfacecom.aquima.interactions.portal.IMovingContentManager
-
notifyMove
public void notifyMove(com.aquima.interactions.foundation.GUID id) - Specified by:
notifyMove
in interfacecom.aquima.interactions.portal.IMovingContentManager
-
canMove
public boolean canMove()- Specified by:
canMove
in interfacecom.aquima.interactions.portal.IMovingContentManager
-
delete
public void delete(com.aquima.interactions.foundation.GUID id, com.aquima.interactions.project.IUserData user, boolean checkRoles) - Specified by:
delete
in interfacecom.aquima.interactions.portal.IContentManager
-
isAuthorized
public boolean isAuthorized(com.aquima.interactions.foundation.GUID id, com.aquima.interactions.project.IUserData user) - Specified by:
isAuthorized
in interfacecom.aquima.interactions.portal.IContentManager
-
readBytes
@Deprecated public int readBytes(com.aquima.interactions.foundation.GUID id, long position, byte[] buffer, int offset, int length, com.aquima.interactions.project.IUserData user) Deprecated.- Specified by:
readBytes
in interfacecom.aquima.interactions.portal.IContentManager
-
hasDisposableContent
public boolean hasDisposableContent()- Specified by:
hasDisposableContent
in interfacecom.aquima.interactions.portal.IContentManager
-
getDisposableContent
public com.aquima.interactions.portal.IDisposableContent getDisposableContent()- Specified by:
getDisposableContent
in interfacecom.aquima.interactions.portal.IContentManager
-
toMetadataPath
Calculates the file system path in which metadata is stored for content identified by the provided identifier.The path that is returned will:
- reference a file (as opposed to a directory)
- not start with a file name-separator
@param GUID content identifier (cannot be
null
).- Returns:
- A (relative) path (never
null
).
-
toContentPath
Calculates the file system path in which content is stored that is identified by the provided identifier.The path that is returned will:
- reference a file (as opposed to a directory)
- not start with a file name-separator
@param GUID content identifier (cannot be
null
).- Returns:
- A (relative) path (never
null
).
-