@@ -269,7 +269,7 @@ def misp_attribute_collection_to_stix1(
269269 filename = input_files [0 ]
270270 if isinstance (filename , str ):
271271 filename = Path (filename ).resolve ()
272- parser .parse_json_content (filename )
272+ parser .parse_json_file (filename )
273273 name = _check_filename (
274274 filename .parent , f'{ filename .name } .out' , output_dir , output_name
275275 )
@@ -290,7 +290,7 @@ def misp_attribute_collection_to_stix1(
290290 if in_memory :
291291 for filename in input_files :
292292 try :
293- parser .parse_json_content (filename )
293+ parser .parse_json_file (filename )
294294 current = parser .stix_package
295295 for campaign in current .campaigns :
296296 stix_package .add_campaign (campaign )
@@ -319,7 +319,7 @@ def misp_attribute_collection_to_stix1(
319319 tmp_path = name .parent
320320 for filename in input_files :
321321 try :
322- parser .parse_json_content (filename )
322+ parser .parse_json_file (filename )
323323 package = parser .stix_package
324324 for feature in _STIX1_features :
325325 values = getattr (package , feature )
@@ -364,7 +364,7 @@ def misp_attribute_collection_to_stix1(
364364 try :
365365 if isinstance (filename , str ):
366366 filename = Path (filename ).resolve ()
367- parser .parse_json_content (filename )
367+ parser .parse_json_file (filename )
368368 name = _check_output (
369369 filename .parent , f'{ filename .name } .out' , output_dir
370370 )
@@ -400,7 +400,7 @@ def misp_event_collection_to_stix1(
400400 try :
401401 if not isinstance (filename , Path ):
402402 filename = Path (filename ).resolve ()
403- parser .parse_json_content (filename )
403+ parser .parse_json_file (filename )
404404 name = _check_filename (
405405 filename .parent , f'{ filename .name } .out' , output_dir , output_name
406406 )
@@ -421,7 +421,7 @@ def misp_event_collection_to_stix1(
421421 try :
422422 if not isinstance (filename , Path ):
423423 filename = Path (filename ).resolve ()
424- parser .parse_json_content (filename )
424+ parser .parse_json_file (filename )
425425 if parser .stix_package .related_packages is not None :
426426 for related_package in parser .stix_package .related_packages :
427427 stix_package .add_related_package (related_package )
@@ -440,7 +440,7 @@ def misp_event_collection_to_stix1(
440440 try :
441441 if not isinstance (filename , Path ):
442442 filename = Path (filename ).resolve ()
443- parser .parse_json_content (filename )
443+ parser .parse_json_file (filename )
444444 content = _get_events (parser .stix_package , return_format )
445445 with open (name , 'wt' , encoding = 'utf-8' ) as f :
446446 f .write (f'{ header } { content } ' )
@@ -450,7 +450,7 @@ def misp_event_collection_to_stix1(
450450 try :
451451 if not isinstance (filename , Path ):
452452 filename = Path (filename ).resolve ()
453- parser .parse_json_content (filename )
453+ parser .parse_json_file (filename )
454454 content = _get_events (parser .stix_package , return_format )
455455 with open (name , 'at' , encoding = 'utf-8' ) as f :
456456 f .write (f'{ separator } { content } ' )
@@ -465,7 +465,7 @@ def misp_event_collection_to_stix1(
465465 try :
466466 if not isinstance (filename , Path ):
467467 filename = Path (filename ).resolve ()
468- parser .parse_json_content (filename )
468+ parser .parse_json_file (filename )
469469 name = _check_output (
470470 filename .parent , f'{ filename .name } .out' , output_dir
471471 )
@@ -493,7 +493,7 @@ def misp_collection_to_stix2(
493493 try :
494494 if not isinstance (filename , Path ):
495495 filename = Path (filename ).resolve ()
496- parser .parse_json_content (filename )
496+ parser .parse_json_file (filename )
497497 name = _check_filename (
498498 filename .parent , f'{ filename .name } .out' , output_dir , output_name
499499 )
@@ -509,7 +509,7 @@ def misp_collection_to_stix2(
509509 try :
510510 if not isinstance (filename , Path ):
511511 filename = Path (filename ).resolve ()
512- parser .parse_json_content (filename )
512+ parser .parse_json_file (filename )
513513 except Exception as exception :
514514 traceback ['fails' ].append (f'{ filename } - { exception .__str__ ()} ' )
515515 if any (filename not in traceback .get ('fails' , []) for filename in input_files ):
@@ -537,7 +537,7 @@ def misp_collection_to_stix2(
537537 filename = input_files [0 ]
538538 if not isinstance (filename , Path ):
539539 filename = Path (filename ).resolve ()
540- parser .parse_json_content (filename )
540+ parser .parse_json_file (filename )
541541 stix_objects = json .dumps (
542542 [parser .fetch_stix_objects ], cls = STIXJSONEncoder , indent = 4
543543 )
@@ -550,7 +550,7 @@ def misp_collection_to_stix2(
550550 try :
551551 if not isinstance (filename , Path ):
552552 filename = Path (filename ).resolve ()
553- parser .parse_json_content (filename )
553+ parser .parse_json_file (filename )
554554 stix_objects = json .dumps (
555555 [parser .fetch_stix_objects ], cls = STIXJSONEncoder , indent = 4
556556 )
@@ -572,7 +572,7 @@ def misp_collection_to_stix2(
572572 try :
573573 if not isinstance (filename , Path ):
574574 filename = Path (filename ).resolve ()
575- parser .parse_json_content (filename )
575+ parser .parse_json_file (filename )
576576 name = _check_output (
577577 filename .parent , f'{ filename .name } .out' , output_dir
578578 )
@@ -602,7 +602,7 @@ def misp_to_stix1(
602602 try :
603603 if not isinstance (filename , Path ):
604604 filename = Path (filename ).resolve ()
605- parser .parse_json_content (filename )
605+ parser .parse_json_file (filename )
606606 name = _check_filename (
607607 filename .parent , f'{ filename .name } .out' , output_dir , output_name
608608 )
0 commit comments