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

@@ -0,0 +1,53 @@
/*
* #%L
* Alfresco Data model classes
* %%
* Copyright (C) 2005 - 2021 Alfresco Software Limited
* %%
* This file is part of the Alfresco software.
* If the software was purchased under a paid Alfresco license, the terms of
* the paid license agreement will prevail. Otherwise, the software is
* provided under the following open source license terms:
*
* Alfresco is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* Alfresco is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with Alfresco. If not, see <http://www.gnu.org/licenses/>.
* #L%
*/
package org.alfresco.service.cmr.repository;
import org.alfresco.api.AlfrescoPublicApi;
import org.alfresco.service.Experimental;
/**
* Unable to access as content is in an Archived state.
* Default status is <i>Precondition Failed<i> Client Error = 412
*
* @author David Edwards
*/
@Experimental
@AlfrescoPublicApi
public class ArchivedIOException extends ContentIOException
{
private static final long serialVersionUID = 3258135874596276087L;
public ArchivedIOException(String msg)
{
super(msg);
}
public ArchivedIOException(String msg, Throwable cause)
{
super(msg, cause);
}
}