From 6dc4b8a79a07857f415e6da3955f8c14eafca38a Mon Sep 17 00:00:00 2001
From: 648540858 <648540858@qq.com>
Date: 星期五, 15 十月 2021 15:05:02 +0800
Subject: [PATCH] 修复点播与录像回放sdp信息sdp-ip的取值错误,修复回放信令错误
---
src/main/java/com/genersoft/iot/vmp/gb28181/utils/XmlUtil.java | 14 ++++----------
1 files changed, 4 insertions(+), 10 deletions(-)
diff --git a/src/main/java/com/genersoft/iot/vmp/gb28181/utils/XmlUtil.java b/src/main/java/com/genersoft/iot/vmp/gb28181/utils/XmlUtil.java
index c82ba60..4220d81 100644
--- a/src/main/java/com/genersoft/iot/vmp/gb28181/utils/XmlUtil.java
+++ b/src/main/java/com/genersoft/iot/vmp/gb28181/utils/XmlUtil.java
@@ -17,6 +17,7 @@
import org.dom4j.io.SAXReader;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
+import org.springframework.util.StringUtils;
/**
* 鍩轰簬dom4j鐨勫伐鍏峰寘
@@ -114,12 +115,12 @@
// 濡傛灉鏄睘鎬�
for (Object o : element.attributes()) {
Attribute attr = (Attribute) o;
- if (!isEmpty(attr.getValue())) {
+ if (!StringUtils.isEmpty(attr.getValue())) {
json.put("@" + attr.getName(), attr.getValue());
}
}
List<Element> chdEl = element.elements();
- if (chdEl.isEmpty() && !isEmpty(element.getText())) {// 濡傛灉娌℃湁瀛愬厓绱�,鍙湁涓�涓��
+ if (chdEl.isEmpty() && !StringUtils.isEmpty(element.getText())) {// 濡傛灉娌℃湁瀛愬厓绱�,鍙湁涓�涓��
json.put(element.getName(), element.getText());
}
@@ -150,7 +151,7 @@
} else { // 瀛愬厓绱犳病鏈夊瓙鍏冪礌
for (Object o : element.attributes()) {
Attribute attr = (Attribute) o;
- if (!isEmpty(attr.getValue())) {
+ if (!StringUtils.isEmpty(attr.getValue())) {
json.put("@" + attr.getName(), attr.getValue());
}
}
@@ -159,12 +160,5 @@
}
}
}
- }
-
- public static boolean isEmpty(String str) {
- if (str == null || str.trim().isEmpty() || "null".equals(str)) {
- return true;
- }
- return false;
}
}
--
Gitblit v1.8.0