From 20153579e6f442a048390458b6abc08679955173 Mon Sep 17 00:00:00 2001 From: Eason Date: Thu, 24 Jun 2021 10:30:48 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9codecheck=E4=BB=A3=E7=A0=81?= =?UTF-8?q?=E8=A7=84=E8=8C=83?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../yanzhenjie/andserver/ServiceAbility.java | 10 +++---- .../component/AppExceptionResolver.java | 2 +- .../andserver/controller/TestController.java | 4 +-- .../andserver/dialog/CustomAttachPopup2.java | 2 +- .../andserver/provider/ListProvider.java | 2 +- .../andserver/slice/ListAbilitySlice.java | 2 +- .../andserver/slice/MainAbilitySlice.java | 6 ++--- .../yanzhenjie/andserver/util/FileUtils.java | 27 ++++++++++--------- .../yanzhenjie/andserver/util/NetUtils.java | 2 +- .../resources/rawfile/web/js/jquery-form.js | 1 - 10 files changed, 30 insertions(+), 28 deletions(-) diff --git a/entry/src/main/java/com/yanzhenjie/andserver/ServiceAbility.java b/entry/src/main/java/com/yanzhenjie/andserver/ServiceAbility.java index fb6cf3e..a8b21d3 100644 --- a/entry/src/main/java/com/yanzhenjie/andserver/ServiceAbility.java +++ b/entry/src/main/java/com/yanzhenjie/andserver/ServiceAbility.java @@ -44,7 +44,7 @@ public class ServiceAbility extends Ability { try { CommonEventManager.publishCommonEvent(eventData); } catch (RemoteException e) { - e.printStackTrace(); + e.fillInStackTrace(); } } else { @@ -54,7 +54,7 @@ public class ServiceAbility extends Ability { try { CommonEventManager.publishCommonEvent(eventData); } catch (RemoteException e) { - e.printStackTrace(); + e.fillInStackTrace(); } } @@ -68,19 +68,19 @@ public class ServiceAbility extends Ability { try { CommonEventManager.publishCommonEvent(eventData); } catch (RemoteException e) { - e.printStackTrace(); + e.fillInStackTrace(); } } @Override public void onException(Exception e) { - e.printStackTrace(); + e.fillInStackTrace(); mIntent.setParam("andserver", 2); CommonEventData eventData = new CommonEventData(mIntent); try { CommonEventManager.publishCommonEvent(eventData); } catch (RemoteException re) { - re.printStackTrace(); + re.fillInStackTrace(); } } }) diff --git a/entry/src/main/java/com/yanzhenjie/andserver/component/AppExceptionResolver.java b/entry/src/main/java/com/yanzhenjie/andserver/component/AppExceptionResolver.java index 2a447ba..c85cbe1 100644 --- a/entry/src/main/java/com/yanzhenjie/andserver/component/AppExceptionResolver.java +++ b/entry/src/main/java/com/yanzhenjie/andserver/component/AppExceptionResolver.java @@ -33,7 +33,7 @@ public class AppExceptionResolver implements ExceptionResolver { @Override public void onResolve( HttpRequest request, HttpResponse response, Throwable e) { - e.printStackTrace(); + e.fillInStackTrace(); if (e instanceof HttpException) { HttpException exception = (HttpException) e; response.setStatus(exception.getStatusCode()); diff --git a/entry/src/main/java/com/yanzhenjie/andserver/controller/TestController.java b/entry/src/main/java/com/yanzhenjie/andserver/controller/TestController.java index 4461c96..e53e0f9 100644 --- a/entry/src/main/java/com/yanzhenjie/andserver/controller/TestController.java +++ b/entry/src/main/java/com/yanzhenjie/andserver/controller/TestController.java @@ -144,9 +144,9 @@ class TestController { fis.read(buffer); } catch (FileNotFoundException e) { - e.printStackTrace(); + e.fillInStackTrace(); } catch (IOException e) { - e.printStackTrace(); + e.fillInStackTrace(); } finally { fis.close(); } diff --git a/entry/src/main/java/com/yanzhenjie/andserver/dialog/CustomAttachPopup2.java b/entry/src/main/java/com/yanzhenjie/andserver/dialog/CustomAttachPopup2.java index e746160..8d0cce9 100644 --- a/entry/src/main/java/com/yanzhenjie/andserver/dialog/CustomAttachPopup2.java +++ b/entry/src/main/java/com/yanzhenjie/andserver/dialog/CustomAttachPopup2.java @@ -59,7 +59,7 @@ public class CustomAttachPopup2 extends AttachPopupView { EventBus.getDefault().post(new MessageEvent()); FileUtils.mkDir(MainAbilitySlice.path.substring(0, MainAbilitySlice.path.length() - 5) + "cache"); } catch (IOException e) { - e.printStackTrace(); + e.fillInStackTrace(); } } }, null, false).show(); diff --git a/entry/src/main/java/com/yanzhenjie/andserver/provider/ListProvider.java b/entry/src/main/java/com/yanzhenjie/andserver/provider/ListProvider.java index d8b9188..0dbee20 100644 --- a/entry/src/main/java/com/yanzhenjie/andserver/provider/ListProvider.java +++ b/entry/src/main/java/com/yanzhenjie/andserver/provider/ListProvider.java @@ -117,7 +117,7 @@ public class ListProvider extends BaseItemProvider { // try { // FileUtils.deleteDir(file); // } catch (IOException e) { -// e.printStackTrace(); +// e.fillInStackTrace(); // } arrayList.remove(i); notifyDataSetItemChanged(i); diff --git a/entry/src/main/java/com/yanzhenjie/andserver/slice/ListAbilitySlice.java b/entry/src/main/java/com/yanzhenjie/andserver/slice/ListAbilitySlice.java index e0b532d..d6f4a11 100644 --- a/entry/src/main/java/com/yanzhenjie/andserver/slice/ListAbilitySlice.java +++ b/entry/src/main/java/com/yanzhenjie/andserver/slice/ListAbilitySlice.java @@ -60,7 +60,7 @@ public class ListAbilitySlice extends AbilitySlice { FileUtils.copy(new File(arrayList.get(i).getFilepath()), new File(path + "/" + arrayList.get(i).getFilename())); } catch (Exception e) { - e.printStackTrace(); + e.fillInStackTrace(); } EventBus.getDefault().post(new MessageEvent()); terminate(); diff --git a/entry/src/main/java/com/yanzhenjie/andserver/slice/MainAbilitySlice.java b/entry/src/main/java/com/yanzhenjie/andserver/slice/MainAbilitySlice.java index afcfce6..508ba5b 100644 --- a/entry/src/main/java/com/yanzhenjie/andserver/slice/MainAbilitySlice.java +++ b/entry/src/main/java/com/yanzhenjie/andserver/slice/MainAbilitySlice.java @@ -249,9 +249,9 @@ public class MainAbilitySlice extends AbilitySlice implements Component.ClickedL FileUtils.copySdcardFile(inputStream, path + "/" + filelist.get(i).getName()); new ToastDialog(getContext()).setText("上传成功,请刷新网页端").show(); } catch (DataAbilityRemoteException e) { - e.printStackTrace(); + e.fillInStackTrace(); } catch (FileNotFoundException e) { - e.printStackTrace(); + e.fillInStackTrace(); } } EventBus.getDefault().post(new MessageEvent()); @@ -342,7 +342,7 @@ public class MainAbilitySlice extends AbilitySlice implements Component.ClickedL try { CommonEventManager.subscribeCommonEvent(myCommonEventSubscriber); } catch (RemoteException e) { - e.printStackTrace(); + e.fillInStackTrace(); } } diff --git a/entry/src/main/java/com/yanzhenjie/andserver/util/FileUtils.java b/entry/src/main/java/com/yanzhenjie/andserver/util/FileUtils.java index 7b38013..5abb0c5 100644 --- a/entry/src/main/java/com/yanzhenjie/andserver/util/FileUtils.java +++ b/entry/src/main/java/com/yanzhenjie/andserver/util/FileUtils.java @@ -63,7 +63,7 @@ public class FileUtils { try { sd = new File(sdDir.getCanonicalPath()); } catch (IOException e) { - e.printStackTrace(); + e.fillInStackTrace(); } return sd.canWrite(); @@ -75,7 +75,7 @@ public class FileUtils { InputStream in = new FileInputStream(file); return in; } catch (FileNotFoundException e) { - e.printStackTrace(); + e.fillInStackTrace(); } return null; } @@ -91,10 +91,11 @@ public class FileUtils { try { boolean isPath = myFolderPath.exists(); if (!isPath) { - myFolderPath.mkdir(); + boolean pathDel = myFolderPath.mkdir(); + System.out.println("path delete " + pathDel); } } catch (Exception e) { - e.printStackTrace(); + e.fillInStackTrace(); } } @@ -140,13 +141,15 @@ public class FileUtils { File file = files[i]; boolean isFile = file.isFile(); if (isFile) { - file.delete(); + boolean fileDel = file.delete(); + System.out.println("file delete " + fileDel); } else { deleteDir(file); } } } - dir.delete(); + boolean dirDel = dir.delete(); + System.out.println("dir delete " + dirDel); } /** @@ -200,7 +203,7 @@ public class FileUtils { try { in.close(); } catch (IOException e) { - e.printStackTrace(); + e.fillInStackTrace(); } in = null; } @@ -208,7 +211,7 @@ public class FileUtils { try { out.close(); } catch (IOException e) { - e.printStackTrace(); + e.fillInStackTrace(); } out = null; } @@ -250,13 +253,13 @@ public class FileUtils { try { getFileList(files[i].getCanonicalPath()); //遍历子文件夹里面的东西 } catch (IOException e) { - e.printStackTrace(); + e.fillInStackTrace(); } } else if (fileName.endsWith("exe")) { // 以***结尾的文件 try { String strFileName = files[i].getCanonicalPath(); } catch (IOException e) { - e.printStackTrace(); + e.fillInStackTrace(); } filelist.add(files[i]); } else { @@ -287,13 +290,13 @@ public class FileUtils { try { getFileList(files[i].getCanonicalPath()); //遍历子文件夹里面的东西 } catch (IOException e) { - e.printStackTrace(); + e.fillInStackTrace(); } } else if (fileName.endsWith("exe")) { // 以***结尾的文件 try { String strFileName = files[i].getCanonicalPath(); } catch (IOException e) { - e.printStackTrace(); + e.fillInStackTrace(); } filelist.add(files[i]); } else { diff --git a/entry/src/main/java/com/yanzhenjie/andserver/util/NetUtils.java b/entry/src/main/java/com/yanzhenjie/andserver/util/NetUtils.java index 202c828..2d4e29b 100644 --- a/entry/src/main/java/com/yanzhenjie/andserver/util/NetUtils.java +++ b/entry/src/main/java/com/yanzhenjie/andserver/util/NetUtils.java @@ -47,7 +47,7 @@ public class NetUtils { try { enumeration = NetworkInterface.getNetworkInterfaces(); } catch (SocketException e) { - e.printStackTrace(); + e.fillInStackTrace(); } if (enumeration != null) { while (enumeration.hasMoreElements()) { diff --git a/entry/src/main/resources/rawfile/web/js/jquery-form.js b/entry/src/main/resources/rawfile/web/js/jquery-form.js index 2b6c4d6..044549b 100644 --- a/entry/src/main/resources/rawfile/web/js/jquery-form.js +++ b/entry/src/main/resources/rawfile/web/js/jquery-form.js @@ -668,7 +668,6 @@ $.fn.ajaxSubmit = function(options) { } - //log('response detected'); var docRoot = doc.body ? doc.body : doc.documentElement; xhr.responseText = docRoot ? docRoot.innerHTML : null; xhr.responseXML = doc.XMLDocument ? doc.XMLDocument : doc; -- Gitee