This repository was archived by the owner on Jun 11, 2024. It is now read-only.
File tree Expand file tree Collapse file tree 1 file changed +19
-0
lines changed
browserup-proxy-core/src/main/java/com/browserup/harreader/model Expand file tree Collapse file tree 1 file changed +19
-0
lines changed Original file line number Diff line number Diff line change 22
33import com .fasterxml .jackson .annotation .JsonIgnoreProperties ;
44import com .fasterxml .jackson .annotation .JsonInclude ;
5+ import com .fasterxml .jackson .databind .ObjectMapper ;
56
7+ import java .io .File ;
8+ import java .io .IOException ;
9+ import java .io .OutputStream ;
10+ import java .io .Writer ;
611import java .util .Objects ;
712
813/**
1318@ JsonIgnoreProperties (ignoreUnknown = true )
1419public class Har {
1520
21+ private static final ObjectMapper OBJECT_MAPPER = new ObjectMapper ();
22+
1623 private HarLog log ;
1724
1825 /**
@@ -41,4 +48,16 @@ public boolean equals(Object o) {
4148 public int hashCode () {
4249 return Objects .hash (log );
4350 }
51+
52+ public void writeTo (Writer writer ) throws IOException {
53+ OBJECT_MAPPER .writeValue (writer , this );
54+ }
55+
56+ public void writeTo (OutputStream os ) throws IOException {
57+ OBJECT_MAPPER .writeValue (os , this );
58+ }
59+
60+ public void writeTo (File file ) throws IOException {
61+ OBJECT_MAPPER .writeValue (file , this );
62+ }
4463}
You can’t perform that action at this time.
0 commit comments