Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -65,13 +65,20 @@ public Builder validate(String urn, URL url, IParameters<String> userData, IMoni
JSONObject assetNode;

if (userData.contains("asset")) {
if(userData.contains("cog")) {
throw new KlabIllegalArgumentException("STAC asset and cog URL both shouldn't be provided while importing");
}
String requestedAssetId = userData.get("asset", String.class);
assetNode = STACCollectionParser.readAssetInformationFromCollection(collectionUrl, collectionData, requestedAssetId);

} else if (userData.contains("jsonSelector")) {
if (!userData.contains("jsonValue")) {
throw new KlabIllegalArgumentException("Both jsonSelector and jsonValue must be provided");
}

if(userData.contains("cog")) {
throw new KlabIllegalArgumentException("jsonSelector and jsonValue shouldn't be provided along with cog URL while importing");
}

Predicate<JSONObject> predicate = STACPathExpression.STACAssetPredicate
.fromKongJsonObject(userData.get("jsonSelector", String.class), userData.get("jsonValue", String.class));
Expand Down
Loading