• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  * Copyright (c) 2023 Huawei Device Co., Ltd.
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  *     http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  */
16 
17 package ohos;
18 
19 /**
20  * scanErrorEnum info
21  *
22  * @since 2023/12/4
23  */
24 
25 public enum ScanErrorEnum {
26     SCAN_ENTRANCE_PARSER_ERROR(9132000, "ScanEntrance main exit, parser failed."),
27     SCAN_ENTRANCE_VERIFY_ERROR(9132001, "ScanEntrance main exit, verify failed."),
28     SCAN_ENTRANCE_COMPRESS_ERROR(9133002, "ScanEntrance main exit, compress failed."),
29     SCAN_VERIFY_UTILITY_EMPTY_ERROR(9132100, "ScanVerify commandVerify utility is null."),
30     SCAN_VERIFY_INPUT_EMPTY_ERROR(9132101, "ScanVerify commandVerify input is null."),
31     SCAN_VERIFY_INPUT_INVALID_ERROR(9132102, "ScanVerify commandVerify input is invalid!"),
32     SCAN_VERIFY_OUT_PATH_EMPTY_ERROR(9132103, "ScanVerify commandVerify outPath is null."),
33     SCAN_VERIFY_STAT_FILE_SIZE_INVALID_ERROR(9132104,
34             "ScanVerify commandVerify statFileSize is invalid! Must be integer in [0, 4294967295]"),
35     SCAN_VERIFY_STAT_PARAMETER_EMPTY_ERROR(9132105, "ScanVerify commandVerify stat parameter is null. " +
36             "At least one of the parameters: --stat-duplicate true | --stat-suffix true | --stat-file-size 0"),
37     STAT_DUPLICATE_CREATE_FILE_ERROR(9131300, "statDuplicate create target file parent directory failed."),
38     STAT_DUPLICATE_INPUT_STREAM_ERROR(9134301, "md5HashCode InputStream failed IOException "),
39     STAT_DUPLICATE_MESSAGE_DIGEST_ERROR(9134302,
40             "md5HashCode MessageDigest failed NoSuchAlgorithmException "),
41     SCAN_STAT_FILE_SIZE_CREATE_FILE_PARENT_ERROR(9131400,
42             "ScanStatFileSize statFileSize create target file parent directory failed."),
43     SCAN_MKDIRS_ERROR(9131200, "scanProcess create out file parent directory failed."),
44     SCAN_NOT_FOUND_ERROR(9131201, "scanProcess file not found exception."),
45     SCAN_REMIND_ERROR(9133202, "scanProcess exception "),
46     SCAN_COMPRESS_ERROR(9133203, "scanProcess compress failed."),
47     SCAN_DELETE_ERROR(9131204, "scanProcess delete dest file failed."),
48     SCAN_NO_FILE_ERROR(9131205, "no file in this file path."),
49     SCAN_UNPACK_ERROR(9131206, "unpack hap failed IOException "),
50     SCAN_UNPACK_STREAM_ERROR(9131207, "unpack hap FileOutputStream failed IOException "),
51     SCAN_GET_JS_TEMPLATE_ERROR(9131209, "getJsTemplate failed IOException "),
52     SCAN_WRITEFILE_ERROR(9131209, "writeFile failed IOException "),
53     SUFFIX_MKDIRS_ERROR(9131500, "statSuffix create target file parent directory failed."),
54     SUFFIX_UNPACK_ERROR(9131501, "unpack hap failed IOException "),
55     SUFFIX_UNPACK_STREAM_ERROR(9131502, "unpack hap FileOutputStream failed IOException ");
56 
57     /**
58      * error codes of scan tool.
59      */
60     public final int code;
61 
62     /**
63      * error messages from scan tool.
64      */
65     public final String msg;
66 
ScanErrorEnum(int code, String msg)67     ScanErrorEnum(int code, String msg) {
68         this.code = code;
69         this.msg = msg;
70     }
71 
72     /**
73      * scan tool error string
74      *
75      * @return error message
76      */
toString()77     public String toString() {
78         return "code:" + this.code + " error:" + this.msg;
79     }
80 }
81