MCPcopy Create free account
hub / github.com/Maschell/JNUSTool / readMeta

Method readMeta

src/de/mas/jnustool/NUSTitle.java:301–329  ·  view source on GitHub ↗
(InputStream bis)

Source from the content-addressed store, hash-verified

299 }
300
301 public NUSTitleInformation readMeta(InputStream bis) {
302 DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
303 DocumentBuilder builder;
304
305 String ID6 = null;
306 try {
307 builder = factory.newDocumentBuilder();
308 Document document = builder.parse(bis);
309 String proc = document.getElementsByTagName("product_code").item(0).getTextContent().toString();
310 String comp = document.getElementsByTagName("company_code").item(0).getTextContent().toString();
311 String title_id = document.getElementsByTagName("title_id").item(0).getTextContent().toString();
312
313 String longname = document.getElementsByTagName("longname_en").item(0).getTextContent().toString();
314 longname = longname.replace("\n", " ");
315 String id = proc.substring(proc.length()-4, proc.length());
316 comp = comp.substring(comp.length()-2, comp.length());
317 ID6 = id+comp;
318 String company_code = document.getElementsByTagName("company_code").item(0).getTextContent().toString();
319 String content_platform = document.getElementsByTagName("content_platform").item(0).getTextContent().toString();
320 String region = document.getElementsByTagName("region").item(0).getTextContent().toString();
321 NUSTitleInformation nusinfo = new NUSTitleInformation(Util.StringToLong(title_id),longname,ID6,proc,content_platform,company_code,(int) Util.StringToLong(region),new String[1]);
322 return nusinfo;
323
324 } catch (ParserConfigurationException | SAXException | IOException e) {
325 Logger.log("Error while parsing the meta files");
326 }
327 return null;
328
329 }
330
331 public FST getFst() {
332 return fst;

Callers 2

NUSTitleMethod · 0.95
callMethod · 0.95

Calls 4

StringToLongMethod · 0.95
logMethod · 0.95
parseMethod · 0.45
toStringMethod · 0.45

Tested by

no test coverage detected