66import eu .clarin .cmdi .curation .utils .TimeUtils ;
77import eu .clarin .cmdi .curation .xml .XMLMarshaller ;
88import eu .clarin .cmdi .rasa .DAO .CheckedLink ;
9- import org .slf4j .Logger ;
10- import org .slf4j .LoggerFactory ;
119
1210import javax .xml .bind .annotation .*;
1311import java .io .OutputStream ;
2220@ XmlAccessorType (XmlAccessType .FIELD )
2321public class CMDInstanceReport implements Report <CollectionReport > {
2422
25- private static final Logger logger = LoggerFactory .getLogger (CMDInstanceReport .class );
26-
2723 public String parentName ;
2824
2925 @ XmlAttribute
@@ -98,7 +94,7 @@ public static class URLElement {
9894 public String message ;
9995
10096 @ XmlAttribute (name = "http-status" )
101- public Integer status ;
97+ public String status ;
10298
10399 @ XmlAttribute (name = "content-type" )
104100 public String contentType ;
@@ -120,13 +116,13 @@ public static class URLElement {
120116
121117 public URLElement convertFromLinkCheckerURLElement (CheckedLink checkedLink ) {
122118 url = checkedLink .getUrl ();
123- method = checkedLink .getMethod ();
124- status = checkedLink .getStatus ();
119+ method = checkedLink .getMethod ()== null ? "n/a" : checkedLink . getMethod () ;
120+ status = checkedLink .getStatus ()== null ? "n/a" : String . valueOf ( checkedLink . getStatus ()) ;
125121 category = checkedLink .getCategory ().name ();
126- contentType = checkedLink .getContentType ();
127- expectedContentType = checkedLink .getExpectedMimeType ();
128- byteSize = String .valueOf (checkedLink .getByteSize ());
129- duration = TimeUtils .humanizeToTime (checkedLink .getDuration ());
122+ contentType = checkedLink .getContentType ()== null ? "n/a" : checkedLink . getContentType () ;
123+ expectedContentType = checkedLink .getExpectedMimeType ()== null ? "n/a" : checkedLink . getExpectedMimeType () ;
124+ byteSize = checkedLink . getByteSize ()== null ? "n/a" : String .valueOf (checkedLink .getByteSize ());
125+ duration = checkedLink . getDuration ()== null ? "n/a" : TimeUtils .humanizeToTime (checkedLink .getDuration ());
130126 timestamp = checkedLink .getCheckingDate ().toString ();
131127
132128 return this ;
0 commit comments