ACS-2222 Add ArchivedIOException (#802)

`ArchivedIOException` and `ArchivedContentException` added to provide an appropriate response when attempting to access content that is archived, for example in GLACIER s3.

Discovered and fixed a bug, when producing an error during content streaming that caused clients to hang. Content Length now set to `-1` when any `ContentIOException` is thrown so that any clients are not expecting and waiting to received the content.
This commit is contained in:
David Edwards
2021-11-19 11:36:35 +00:00
committed by GitHub
parent be4fa79c76
commit d698619bff
7 changed files with 169 additions and 1 deletions

View File

@@ -47,6 +47,7 @@ import org.alfresco.api.AlfrescoPublicApi;
import org.alfresco.error.AlfrescoRuntimeException;
import org.alfresco.repo.content.filestore.FileContentWriter;
import org.alfresco.repo.content.transform.TransformerDebug;
import org.alfresco.service.cmr.repository.ArchivedIOException;
import org.alfresco.service.cmr.repository.ContentAccessor;
import org.alfresco.service.cmr.repository.ContentIOException;
import org.alfresco.service.cmr.repository.ContentReader;
@@ -429,6 +430,7 @@ public abstract class AbstractContentReader extends AbstractContentAccessor impl
}
catch (Throwable e)
{
if (e instanceof ArchivedIOException) throw e;
throw new ContentIOException("Failed to open stream onto channel: \n" +
" accessor: " + this,
e);