@@ -59,6 +59,8 @@ public class AleappTask extends AbstractTask {
5959 public static final MediaType ALEAPP_ACTIVITY_MEDIATYPE = MediaType .application (ALEAPP_APPLICATION_PREFIX + "activity" );
6060 public static final MediaType ALEAPP_DEVICE_INFO_MEDIATYPE = MediaType .application (ALEAPP_APPLICATION_PREFIX + "deviceinfo" );
6161
62+ public static final String ALEAPP_PLUGIN_CATEGORY_KEY = "aleapp_category" ;
63+
6264 private static final String DEVICE_INFO_HTML = "DeviceInfo.html" ;
6365
6466 private static final String CASE_EVIDENCE_NAME = "ALEAPP_Results" ;
@@ -245,6 +247,8 @@ public void process(IItem item) throws Exception {
245247 processExtractionRoot (item );
246248 } else if (isCaseEvidence (item )) {
247249 processCaseEvidence (item );
250+ } else if (isCategoryEvidence (item )) {
251+ processCategoryEvidence (item );
248252 } else if (isPluginEvidence (item )) {
249253 processPluginEvidence (item );
250254 } else if (isDeviceInfoEvidence (item )) {
@@ -274,6 +278,10 @@ private boolean isCaseEvidence(IItem evidence) {
274278 return ALEAPP_CASE_MEDIATYPE .equals (evidence .getMediaType ());
275279 }
276280
281+ private boolean isCategoryEvidence (IItem evidence ) {
282+ return ALEAPP_CATEGORY_MEDIATYPE .equals (evidence .getMediaType ());
283+ }
284+
277285 private boolean isPluginEvidence (IItem evidence ) {
278286 return ALEAPP_PLUGIN_RESULTS_MEDIATYPE .equals (evidence .getMediaType ());
279287 }
@@ -349,7 +357,6 @@ private void processCaseEvidence(IItem caseEvidence) throws Exception {
349357 categoryEvidence .setPath (caseEvidence .getPath () + "/" + name );
350358 categoryEvidence .setIdInDataSource ("" );
351359 categoryEvidence .setExtraAttribute (ExtraProperties .DECODED_DATA , true );
352- categoryEvidence .setHasChildren (true );
353360
354361 worker .processNewItem (categoryEvidence , ProcessTime .LATER );
355362
@@ -358,6 +365,7 @@ private void processCaseEvidence(IItem caseEvidence) throws Exception {
358365
359366 Item pluginEvidence = (Item ) categoryItem .createChildItem ();
360367 pluginEvidence .setMediaType (ALEAPP_PLUGIN_RESULTS_MEDIATYPE );
368+ pluginEvidence .setTempAttribute (ALEAPP_PLUGIN_CATEGORY_KEY , categoryItem );
361369
362370 String name = StringUtils .firstNonBlank ((String ) plugin .getArtifactInfo ().get ("name" ), plugin .getName ());
363371 pluginEvidence .setName (name );
@@ -386,7 +394,13 @@ private void processCaseEvidence(IItem caseEvidence) throws Exception {
386394 deviceInfoEvidence .setPath (caseEvidence .getPath () + "/" + DEVICE_INFO_HTML );
387395 deviceInfoEvidence .setIdInDataSource ("" );
388396 worker .processNewItem (deviceInfoEvidence , ProcessTime .LATER );
397+ }
389398
399+ private void processCategoryEvidence (IItem categoryEvidence ) throws Exception {
400+ if (!categoryEvidence .hasChildren ()) {
401+ logger .info ("Ignoring Aleapp category {}: no children" , categoryEvidence .getName ());
402+ categoryEvidence .setToIgnore (true );
403+ }
390404 }
391405
392406 private void processPluginEvidence (IItem pluginEvidence ) throws Exception {
0 commit comments