def create_file_from_file(file_path, template_hash, output_file, exception_type): """ Read the template from the template file, perform any substitutions, and write it to the output file. :param file_path: the absolute file path of the source template :param template_hash: a dictionary of substitution values :param output_file: the file to write :param exception_type: the type of exception to throw if needed """ _method_name = 'create_file_from_file' try: template_stream = FileUtils.getFileAsStream(file_path) if template_stream is not None: _create_file_from_stream(template_stream, template_hash, output_file) except (IOException, IllegalArgumentException), ie: ex = exception_helper.create_exception(exception_type, 'WLSDPLY-01666', file_path, ie) __logger.throwing(ex, class_name=__class_name, method_name=_method_name) raise ex
def _load_test_category_file(self, category_file_path): category_input_stream = FileUtils.getFileAsStream(category_file_path) self.assertNotEquals(category_input_stream, None) json_translator = JsonStreamTranslator(category_file_path, category_input_stream) return json_translator.parse()