Class AssetImportConflicts
- java.lang.Object
-
- de.xima.fc.gui.bean.resource.model.AssetImportConflicts
-
- All Implemented Interfaces:
Serializable
public class AssetImportConflicts extends Object implements Serializable
Collects uploaded asset exports (such as tenant resources or templates) that conflict with an existing asset in the target tenant, i.e. that have the same UUID as an existing asset. The user chooses aresolutionfor each conflict before the conflicting exports are imported.- Since:
- 8.6.0
- Author:
- XIMA MEDIA GmbH
- See Also:
- Serialized Form
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classAssetImportConflicts.AssetImportConflictAn uploaded asset export that conflicts with an existing asset.
-
Constructor Summary
Constructors Constructor Description AssetImportConflicts()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidadd(String fileName, byte[] data, AssetImportAnalysisResult analysis)Adds a conflicting upload.List<AssetImportConflicts.AssetImportConflict>drain()Removes all conflicts and returns them.List<AssetImportConflicts.AssetImportConflict>getConflicts()booleanisEmpty()voidsetAll(EAssetImportConflictResolution resolution)Applies the given resolution to all conflicts.
-
-
-
Method Detail
-
add
public void add(String fileName, byte[] data, AssetImportAnalysisResult analysis)
Adds a conflicting upload. The resolution is preset toEAssetImportConflictResolution.REPLACEif the user may overwrite the existing asset, and toEAssetImportConflictResolution.CREATE_NEWotherwise.- Parameters:
fileName- The name of the uploaded file.data- The content of the uploaded file, needed to import it once the conflict was resolved.analysis- The analysis result of the uploaded file, describing the conflict.
-
getConflicts
public List<AssetImportConflicts.AssetImportConflict> getConflicts()
- Returns:
- All conflicts that were not resolved yet, in the order they were added.
-
isEmpty
public boolean isEmpty()
- Returns:
- Whether there are no unresolved conflicts.
-
setAll
public void setAll(EAssetImportConflictResolution resolution)
Applies the given resolution to all conflicts.EAssetImportConflictResolution.REPLACEis not applied to conflicts whose existing asset the user may not overwrite; those keep their current resolution.- Parameters:
resolution- The resolution to apply.
-
drain
public List<AssetImportConflicts.AssetImportConflict> drain()
Removes all conflicts and returns them.- Returns:
- The conflicts that were removed, in the order they were added.
-
-