mil.dod.th.ose.gui.webapp/src/mil/dod/th/ose/gui/webapp/observation/ViewObsMgrImpl.java
private StreamedContent buildOrDownloadMedia(final Observation observation)
    {
        if (observation == null)
        {
            return new DefaultStreamedContent();
        }
        
        final DigitalMedia media = observation.getDigitalMedia();
        final String encoding = media.getEncoding();
        final byte[] data = media.getValue();
        final String extension =  "." + encoding.split("/")[1];
        final PixelResolution resolution;
        
        if (observation.isSetImageMetadata() && observation.getImageMetadata().getResolution() != null)
        {
            resolution = observation.getImageMetadata().getResolution();
            setDisplayResolution(resolution);
        }
        else
        {
            try
            {
                resolution = getImageResolution(data);
                setDisplayResolution(resolution);
            }
            catch (final IOException e)
            {
                m_HasResolution = false;
            }
        }
        
        return new DefaultStreamedContent(new ByteArrayInputStream(data), encoding, 
                    observation.getUuid().toString() + extension);
    }
/**
     * Method that accepts an observation as a parameter and builds a file from the digital media content
     * stored within. The browser will determine if the image or video type is supported by looking at the file
     * extension. If the type is not supported  then the file will need to be downloaded to view it.
     * 
     * @param observation
     *          The observation that contains the digital media to be viewed or downloaded.
     * @return
     *          {@link StreamedContent} built from the image/video/audio stored in the observation.
     */
Method that accepts an observation as a parameter and builds a file from the digital media content
stored within. The browser will determine if the image or video type is supported by looking at the file
extension. If the type is not supported  then the file will need to be downloaded to view it.

@param observation
The observation that contains the digital media to be viewed or downloaded.
@return
StreamedContent built from the image/video/audio stored in the observation.
Method that accepts an observation as a parameter and builds a file from the digital media content stored within . The browser will determine if the image or video type is supported by looking at the file extension . If the type is not supported then the file will need to be downloaded to view it . @param observation The observation that contains the digital media to be viewed or downloaded . @return StreamedContent built from the image / video / audio stored in the observation .
private StreamedContent buildOrDownloadMedia(final Observation observation)
    {
        if (observation == null)
        {
            return new DefaultStreamedContent();
        }
        final DigitalMedia media = observation.getDigitalMedia();
        final String encoding = media.getEncoding();
        final byte[] data = media.getValue();
        final String extension =  "." + encoding.split("/")[1];
        final PixelResolution resolution;
        if (observation.isSetImageMetadata() && observation.getImageMetadata().getResolution() != null)
        {
            resolution = observation.getImageMetadata().getResolution();
            setDisplayResolution(resolution);
        }
        else
        {
            try
            {
                resolution = getImageResolution(data);
                setDisplayResolution(resolution);
            }
            catch (final IOException e)
            {
                m_HasResolution = false;
            }
        }
        return new DefaultStreamedContent(new ByteArrayInputStream(data), encoding, 
                    observation.getUuid().toString() + extension);
    }
private StreamedContent buildOrDownloadMedia ( final Observation observation ) { if ( observation == null ) { return new DefaultStreamedContent ( ) ; } final DigitalMedia media = observation . getDigitalMedia ( ) ; final String encoding = media . getEncoding ( ) ; final byte [ ] data = media . getValue ( ) ; final String extension = "." + encoding . split ( "/" ) [ 1 ] ; final PixelResolution resolution ; if ( observation . isSetImageMetadata ( ) && observation . getImageMetadata ( ) . getResolution ( ) != null ) { resolution = observation . getImageMetadata ( ) . getResolution ( ) ; setDisplayResolution ( resolution ) ; } else { try { resolution = getImageResolution ( data ) ; setDisplayResolution ( resolution ) ; } catch ( final IOException e ) { m_HasResolution = false ; } } return new DefaultStreamedContent ( new ByteArrayInputStream ( data ) , encoding , observation . getUuid ( ) . toString ( ) + extension ) ; }
Method that accepts an observation as a parameter and builds a file from the digital media content
 stored within.
Method that accepts an observation as a parameter and builds a file from the digital media content stored within .