Update code based on feedback

This commit is contained in:
canpan14
2023-07-12 15:12:07 -04:00
parent 3215bc50c6
commit cb4dde6035
7 changed files with 76 additions and 27 deletions

View File

@@ -102,16 +102,28 @@ public interface DeletedNodes
CollectionWithPagingInfo<Rendition> getRenditions(String archivedId, Parameters parameters);
/**
* Gets a presigned URL to directly access content.
* Gets a presigned URL to directly access content.
*
* @param archivedId The node id for which to obtain the direct access {@code URL}
* @param renditionId The rendition id for which to obtain the direct access {@code URL}
* @param attachment {@code true} if an attachment {@code URL} is requested, {@code false} for an embedded {@code URL}, {@code true} by default.
* @return A direct access {@code URL} object for the content.
*/
* @param archivedId The node id for which to obtain the direct access {@code URL}
* @param renditionId The rendition id for which to obtain the direct access {@code URL}
* @param attachment {@code true} if an attachment {@code URL} is requested, {@code false} for an embedded {@code URL}, {@code true} by default.
* @return A direct access {@code URL} object for the content.
*/
default DirectAccessUrl requestContentDirectUrl(String archivedId, String renditionId, boolean attachment)
{
return requestContentDirectUrl(archivedId, renditionId, attachment, null, null);
return requestContentDirectUrl(archivedId, renditionId, attachment, null);
}
/**
* @param archivedId The node id for which to obtain the direct access {@code URL}
* @param renditionId The rendition id for which to obtain the direct access {@code URL}
* @param attachment {@code true} if an attachment {@code URL} is requested, {@code false} for an embedded {@code URL}, {@code true} by default.
* @param validFor The time at which the direct access {@code URL} will expire.
* @return A direct access {@code URL} object for the content.
*/
default DirectAccessUrl requestContentDirectUrl(String archivedId, String renditionId, boolean attachment, Long validFor)
{
return requestContentDirectUrl(archivedId, renditionId, attachment, validFor, null);
}
/**

View File

@@ -67,11 +67,6 @@ public class DirectAccessUrlHelper
public String getFileName(DirectAccessUrlRequest directAccessUrlRequest)
{
String fileName = null;
if (directAccessUrlRequest != null )
{
fileName = directAccessUrlRequest.getFileName();
}
return fileName;
return directAccessUrlRequest != null ? directAccessUrlRequest.getFileName() : null;
}
}

View File

@@ -301,7 +301,7 @@ public interface Nodes
*/
default DirectAccessUrl requestContentDirectUrl(NodeRef nodeRef, boolean attachment)
{
return requestContentDirectUrl(nodeRef, attachment, null, null);
return requestContentDirectUrl(nodeRef, attachment, null);
}
/**
@@ -313,7 +313,19 @@ public interface Nodes
*/
default DirectAccessUrl requestContentDirectUrl(String nodeId, boolean attachment, Long validFor)
{
return requestContentDirectUrl(validateNode(nodeId), attachment, validFor, null);
return requestContentDirectUrl(validateNode(nodeId), attachment, validFor);
}
/**
* Gets a presigned URL to directly access content.
* @param nodeRef The node reference for which to obtain the direct access {@code URL}
* @param attachment {@code true} if an attachment {@code URL} is requested, {@code false} for an embedded {@code URL}.
* @param validFor The time at which the direct access {@code URL} will expire.
* @return A direct access {@code URL} object for the content.
*/
default DirectAccessUrl requestContentDirectUrl(NodeRef nodeRef, boolean attachment, Long validFor)
{
return requestContentDirectUrl(nodeRef, attachment, validFor, null);
}
/**

View File

@@ -234,7 +234,7 @@ public interface Renditions
default DirectAccessUrl requestContentDirectUrl(String nodeId, String versionId, String renditionId, boolean attachment, Long validFor)
{
NodeRef nodeRef = new NodeRef(StoreRef.STORE_REF_WORKSPACE_SPACESSTORE, nodeId);
return requestContentDirectUrl(nodeRef, versionId, renditionId, attachment, validFor, null);
return requestContentDirectUrl(nodeRef, versionId, renditionId, attachment, validFor);
}
/**
@@ -247,7 +247,20 @@ public interface Renditions
*/
default DirectAccessUrl requestContentDirectUrl(NodeRef nodeRef, String versionId, String renditionId, boolean attachment)
{
return requestContentDirectUrl(nodeRef, versionId, renditionId, attachment, null, null);
return requestContentDirectUrl(nodeRef, versionId, renditionId, attachment, null);
}
/**
* @param nodeRef the node reference for which to obtain the direct access {@code URL}
* @param versionId the version id (aka version label)
* @param renditionId the rendition id
* @param attachment {@code true} if an attachment {@code URL} is requested, {@code false} for an embedded {@code URL}
* @param validFor the time at which the direct access {@code URL} will expire
* @return a direct access {@code URL} object for the content.
*/
default DirectAccessUrl requestContentDirectUrl(NodeRef nodeRef, String versionId, String renditionId, boolean attachment, Long validFor)
{
return requestContentDirectUrl(nodeRef, versionId, renditionId, attachment, validFor);
}
/**