Class AddOrUpdateResourceHelper.ResourceOperationResult
- java.lang.Object
-
- org.ametys.plugins.explorer.resources.actions.AddOrUpdateResourceHelper.ResourceOperationResult
-
- Enclosing class:
- AddOrUpdateResourceHelper
public static class AddOrUpdateResourceHelper.ResourceOperationResult extends Object
Class representing the result of a resource operation.
-
-
Field Summary
Fields Modifier and Type Field Description private String
_errorMessage
Type of error in case of unsuccessful operationprivate List<Resource>
_resources
The created or updated resource(s)private boolean
_success
Indicates if the operation was successfulprivate boolean
_unzip
Indicates if an unzip operation was executed
-
Constructor Summary
Constructors Modifier Constructor Description protected
ResourceOperationResult(String errorMessage)
constructor in case of an errorprotected
ResourceOperationResult(List<Resource> resources)
constructor in case of a successful unzip operationprotected
ResourceOperationResult(Resource resource)
constructor in case of a successful operation
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description String
getErrorMessage()
Retrieves the errorMessageResource
getResource()
Retrieves the resource Note thatgetResources()
should be used in case of an unzip.List<Resource>
getResources()
Retrieves the list of resources, in case of an unzip.boolean
isSuccess()
Retrieves the successboolean
isUnzip()
Retrieves the unzip
-
-
-
Field Detail
-
_resources
private final List<Resource> _resources
The created or updated resource(s)
-
_unzip
private final boolean _unzip
Indicates if an unzip operation was executed
-
_success
private final boolean _success
Indicates if the operation was successful
-
_errorMessage
private final String _errorMessage
Type of error in case of unsuccessful operation
-
-
Constructor Detail
-
ResourceOperationResult
protected ResourceOperationResult(Resource resource)
constructor in case of a successful operation- Parameters:
resource
- The resource of this operation
-
ResourceOperationResult
protected ResourceOperationResult(List<Resource> resources)
constructor in case of a successful unzip operation- Parameters:
resources
- The list of resource for this operation
-
ResourceOperationResult
protected ResourceOperationResult(String errorMessage)
constructor in case of an error- Parameters:
errorMessage
- The error message.
-
-
Method Detail
-
getResource
public Resource getResource()
Retrieves the resource Note thatgetResources()
should be used in case of an unzip.- Returns:
- the resource
-
getResources
public List<Resource> getResources()
Retrieves the list of resources, in case of an unzip.- Returns:
- the resource
-
isUnzip
public boolean isUnzip()
Retrieves the unzip- Returns:
- the unzip
-
isSuccess
public boolean isSuccess()
Retrieves the success- Returns:
- the success
-
getErrorMessage
public String getErrorMessage()
Retrieves the errorMessage- Returns:
- the errorMessage
-
-