/*
 * Autopsy Forensic Browser
 * 
 * Copyright 2018 Basis Technology Corp.
 * Contact: carrier <at> sleuthkit <dot> org
 * 
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 * 
 *     http://www.apache.org/licenses/LICENSE-2.0
 * 
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
package org.sleuthkit.autopsy.corecomponents;

import org.sleuthkit.datamodel.Content;
import org.openide.nodes.Node;
import org.sleuthkit.datamodel.BlackboardArtifact;

/**
 * Utility classes for content viewers.
 * In theory, this would live in the contentviewer package,
 * but the initial method was needed only be viewers in 
 * corecomponents and therefore can stay out of public API.
 */
public class DataContentViewerUtility {
    /**
     * Returns the first non-Blackboard Artifact from a Node.
     * Needed for (at least) Hex and Strings that want to view
     * all types of content (not just AbstractFile), but don't want
     * to display an artifact unless that's the only thing there. 
     * Scenario is hash hit or interesting item hit.
     * 
     * @param node Node passed into content viewer
     * @return highest priority content or null if there is no content
     */
    public static Content getDefaultContent(Node node) {
        Content bbContentSeen = null;
        for (Content content :  (node).getLookup().lookupAll(Content.class)) {
            if (content instanceof BlackboardArtifact) {
                bbContentSeen = content;
            }
            else {
                return content;
            }
        }
        return bbContentSeen;
    }
}

@@ -26,17 +26,16 @@
 owser%0A *
- 
 %0A * Copy
@@ -44,16 +44,21 @@
 ght 2018
+-2019
  Basis T
@@ -120,17 +120,16 @@
 %3E org%0A *
- 
 %0A * Lice
@@ -301,17 +301,16 @@
 se at%0A *
- 
 %0A *     
@@ -354,17 +354,16 @@
 E-2.0%0A *
- 
 %0A * Unle
@@ -893,19 +893,16 @@
 viewers.
-%0A *
  In theo
@@ -927,16 +927,19 @@
 e in the
+%0A *
  content
@@ -953,19 +953,16 @@
 package,
-%0A *
  but the
@@ -1006,17 +1006,16 @@
 ewers in
- 
 %0A * core
@@ -1111,16 +1111,17 @@
 ility %7B%0A
+%0A
     /**%0A
@@ -1181,23 +1181,16 @@
  a Node.
-%0A     *
  Needed 
@@ -1196,16 +1196,23 @@
  for (at
+%0A     *
  least) 
@@ -1244,23 +1244,16 @@
  to view
-%0A     *
  all typ
@@ -1275,16 +1275,23 @@
 not just
+%0A     *
  Abstrac
@@ -1312,23 +1312,16 @@
 n't want
-%0A     *
  to disp
@@ -1353,16 +1353,23 @@
 at's the
+%0A     *
  only th
@@ -1379,24 +1379,16 @@
  there. 
-%0A     * 
 Scenario
@@ -1431,17 +1431,16 @@
 .%0A     *
- 
 %0A     * 
@@ -1483,16 +1483,23 @@
  viewer%0A
+     *%0A
      * @
@@ -1694,17 +1694,16 @@
 ontent :
- 
  (node).
@@ -1853,28 +1853,16 @@
        %7D
-%0A           
  else %7B%0A
@@ -1947,16 +1947,17 @@
 ntSeen;%0A
-
     %7D%0A
+%0A
 %7D%0A

Fix DataContentViewerUtility.java formatting