src/main/java/au/org/dcw/twitter/ingest/ui/TweetSanitiserUI.java
private void updateSanitisedJson(final String rawJSON) {
        if (errorState || rawJSON == null || rawJSON.length() == 0) return;

        final List<String> fieldsToKeep = Stream.of(ftkTextArea.getText().split("\n"))
            .map(l -> l.contains(",") ? Stream.of(l.split("[, ]")) : Stream.of(l))
            .flatMap(x -> x)
            .map(String::trim)
            .collect(Collectors.toList());

        final List<String> fieldsToKeepNoMedia = Lists.newArrayList(fieldsToKeep);
        fieldsToKeepNoMedia.remove("entities.media"); // media-safe list

        final Map<String, Object> toKeep =
            buildFieldStructure(skipMediaCheckbox.isSelected() ? fieldsToKeepNoMedia : fieldsToKeep);

        final String sanitisedJSON = sanitiseJSON(rawJSON, toKeep);

        updateTextArea(sanitisedJsonTextArea, sanitisedJSON);
    }
/**
     * Updates the sanitised JSON area, taking into account whether images are wanted
     * and using the fields specified in {@link #ftkTextArea} to decide which fields
     * to keep. Does nothing when the input is invalid. May be called from the Swing
     * thread or off of it.
     *
     * @param rawJSON The raw JSON to consider.
     */
Updates the sanitised JSON area, taking into account whether images are wanted
and using the fields specified in  #ftkTextArea to decide which fields
to keep. Does nothing when the input is invalid. May be called from the Swing
thread or off of it.

@param rawJSON The raw JSON to consider.
Updates the sanitised JSON area taking into account whether images are wanted and using the fields specified in #ftkTextArea to decide which fields to keep . Does nothing when the input is invalid . May be called from the Swing thread or off of it . @param rawJSON The raw JSON to consider .
private void updateSanitisedJson(final String rawJSON) {
        if (errorState || rawJSON == null || rawJSON.length() == 0) return;
        final List<String> fieldsToKeep = Stream.of(ftkTextArea.getText().split("\n"))
            .map(l -> l.contains(",") ? Stream.of(l.split("[, ]")) : Stream.of(l))
            .flatMap(x -> x)
            .map(String::trim)
            .collect(Collectors.toList());
        final List<String> fieldsToKeepNoMedia = Lists.newArrayList(fieldsToKeep);
        fieldsToKeepNoMedia.remove("entities.media"); 
        final Map<String, Object> toKeep =
            buildFieldStructure(skipMediaCheckbox.isSelected() ? fieldsToKeepNoMedia : fieldsToKeep);
        final String sanitisedJSON = sanitiseJSON(rawJSON, toKeep);
        updateTextArea(sanitisedJsonTextArea, sanitisedJSON);
    }
private void updateSanitisedJson ( final String rawJSON ) { if ( errorState || rawJSON == null || rawJSON . length ( ) == 0 ) return ; final List < String > fieldsToKeep = Stream . of ( ftkTextArea . getText ( ) . split ( "\n" ) ) . map ( l -> l . contains ( "," ) ? Stream . of ( l . split ( "[, ]" ) ) : Stream . of ( l ) ) . flatMap ( x -> x ) . map ( String :: trim ) . collect ( Collectors . toList ( ) ) ; final List < String > fieldsToKeepNoMedia = Lists . newArrayList ( fieldsToKeep ) ; fieldsToKeepNoMedia . remove ( "entities.media" ) ; final Map < String , Object > toKeep = buildFieldStructure ( skipMediaCheckbox . isSelected ( ) ? fieldsToKeepNoMedia : fieldsToKeep ) ; final String sanitisedJSON = sanitiseJSON ( rawJSON , toKeep ) ; updateTextArea ( sanitisedJsonTextArea , sanitisedJSON ) ; }
Updates the sanitised JSON area, taking into account whether images are wanted
 and using the fields specified in {@link #ftkTextArea} to decide which fields
 to keep.
Updates the sanitised JSON area taking into account whether images are wanted and using the fields specified in { @link #ftkTextArea } to decide which fields to keep .
// media-safe list