Skip to content
This repository was archived by the owner on Mar 4, 2022. It is now read-only.

Commit 510acf8

Browse files
committed
util
1 parent 7d6c5c3 commit 510acf8

File tree

2 files changed

+9
-5
lines changed

2 files changed

+9
-5
lines changed

src/main/java/com/ning/util/properties/PropertiesUtil.java

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,9 @@
1111
import java.util.Properties;
1212

1313
/**
14-
* Created by wangn on 2017/5/25.
14+
*
15+
* @author wangn
16+
* @date 2017/5/25
1517
*/
1618
public class PropertiesUtil {
1719
public static String getUpLoadFilePath() throws Exception {
@@ -23,7 +25,7 @@ public static String getUpLoadFilePath() throws Exception {
2325
throw new FileException("获取文件路径失败!" + e.getMessage());
2426
}
2527
String filepath = properties.getProperty("upLoadFilePath");
26-
if (filepath == null || filepath.equals("")) {
28+
if (filepath == null || "".equals(filepath)) {
2729
throw new FileException("文件路径不正确:upLoadFilePath=" + filepath);
2830
}
2931
return filepath;

src/main/java/com/ning/util/qqlogin/QQLoginUtil.java

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,14 +9,16 @@
99
import javax.servlet.http.HttpServletRequest;
1010

1111
/**
12-
* Created by wangn on 2017/5/31.
12+
*
13+
* @author wangn
14+
* @date 2017/5/31
1315
*/
1416
public class QQLoginUtil {
1517
public static String getUserOpenID(HttpServletRequest request) throws LoginException {
16-
String openID = null;
18+
String openID;
1719
try {
1820
AccessToken accessTokenObj = (new Oauth()).getAccessTokenByRequest(request);
19-
if (accessTokenObj.getAccessToken().equals("")) {
21+
if ("".equals(accessTokenObj.getAccessToken())) {
2022
throw new LoginException("未获取到参数!");
2123
} else {
2224
openID = new OpenID(accessTokenObj.getAccessToken()).getUserOpenID();

0 commit comments

Comments
 (0)