From 3b55d06b89bf64873e685c3d78fce5affbba3d17 Mon Sep 17 00:00:00 2001 From: zheng_wenlong Date: Tue, 16 Apr 2019 11:20:38 +0900 Subject: Add warehouse server source code. [Patch Set 2] Add ReadMe.md Change-Id: I6ade52d2490f5ca4ba107c1a27ed6d5b39048725 Signed-off-by: zheng_wenlong --- .../app/market/utils/property/KeysConstants.java | 110 ++++++++++++++++++ .../app/market/utils/property/MessageUtil.java | 55 +++++++++ .../java/app/market/utils/property/Option.java | 78 +++++++++++++ .../market/utils/property/PropertyContants.java | 22 ++++ .../app/market/utils/property/PropertyUtil.java | 127 +++++++++++++++++++++ 5 files changed, 392 insertions(+) create mode 100644 appmarket-utils/src/main/java/app/market/utils/property/KeysConstants.java create mode 100644 appmarket-utils/src/main/java/app/market/utils/property/MessageUtil.java create mode 100644 appmarket-utils/src/main/java/app/market/utils/property/Option.java create mode 100644 appmarket-utils/src/main/java/app/market/utils/property/PropertyContants.java create mode 100644 appmarket-utils/src/main/java/app/market/utils/property/PropertyUtil.java (limited to 'appmarket-utils/src/main/java/app/market/utils/property') diff --git a/appmarket-utils/src/main/java/app/market/utils/property/KeysConstants.java b/appmarket-utils/src/main/java/app/market/utils/property/KeysConstants.java new file mode 100644 index 0000000..c739762 --- /dev/null +++ b/appmarket-utils/src/main/java/app/market/utils/property/KeysConstants.java @@ -0,0 +1,110 @@ +/* + * Copyright (c) 2019 TOYOTA MOTOR CORPORATION + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package app.market.utils.property; + +public class KeysConstants { + public static final String PROJECT_ERROR = "project_error"; + public static final String STATUS_UNAUTHORIZED = "status_unauthorized"; + public static final String STATUS_TOO_MANY_CONNECTIONS = "status_too_many_connections"; + public static final String STATUS_FORBIDDEN = "status_forbidden"; + public static final String STATUS_BAD_REQUEST = "bad_request"; + public static final String INVALID_QUERYPARAM = "invalid_query_param"; + public static final String INVALID_BODY = "invalid_body"; + public static final String ALREADY_EXIST = "already_exist"; + public static final String USER_NOT_DELETE = "user_not_delete"; + public static final String EXPIRED_REFRESH_TOKEN = "expired_refresh_token"; + /** ▼▼▼▼▼▼▼▼▼▼ ErrorCode Message ▼▼▼▼▼▼▼▼▼▼ */ + public static final String MISSING_NECESSARY_QUERYPARAM = "missing_necessary_queryparam"; + public static final String THE_PICTURE_SIZES = "the_picture_sizes_should_not_exceed_500KB"; + public static final String UPLOAD_PICTURES_ONLY = "you_can_upload_pictures_only"; + public static final String INVALID_OPERATION = "invalid_operation"; + public static final String RESOURCE_ALREADY_EXISTS = "resource_already_exists"; + public static final String RESOURCE_APP_ALREADY_EXISTS = "resource_app_already_exists"; + public static final String DEVELOPER_IS_NOT_EXIST = "developer_is_not_exist"; + public static final String TYPENAME_ALREADY_EXISTS = "typename_already_exists"; + /** ▲▲▲▲▲▲▲▲▲▲ ErrorCode Message ▲▲▲▲▲▲▲▲▲▲ */ + + /** ▼▼▼▼▼▼▼▼▼▼ login ▼▼▼▼▼▼▼▼▼▼ */ + public static final String LOGIN_LOGINID_IS_NOT_EXIST = "login_loginId_is_not_exist"; + public static final String LOGIN_LOGINID_IS_NOT_EMPTY = "login_loginId_is_not_empty"; + public static final String LOGIN_PASSWORD_IS_NOT_EMPTY = "login_password_is_not_empty"; + /** ▲▲▲▲▲▲▲▲▲▲ login ▲▲▲▲▲▲▲▲▲▲ */ + + /** ▼▼▼▼▼▼▼▼▼▼ user ▼▼▼▼▼▼▼▼▼▼ */ + public static final String USER_PASSWORD_IS_NOT_EMPTY = "user_password_is_not_empty"; + public static final String USER_PASSWORD_IS_NOT_SPACES = "no_spaces_can_be_found_in_the_password"; + public static final String USER_REPASSWORD_IS_NOT_EMPTY = "user_repassword_is_not_empty"; + public static final String USER_USERNAME_IS_NOT_EMPTY = "user_username_is_not_empty"; + public static final String USER_USERNAME_MAX_ERROR = "user_username_max_error"; + public static final String USER_PASSWORD_MAX_ERROR = "user_password_max_error"; + public static final String USER_REPASSWORD_MAX_ERROR = "user_repassword_max_error"; + public static final String USER_MAILADDRESS_MAX_ERROR = "user_mailaddress_max_error"; + public static final String USER_USERNAME_IS_NOT_REPEATED = "user_username_is_not_repeated"; + public static final String USER_MAILADDRESS_IS_NOT_EMPTY = "user_mailaddress_is_not_empty"; + public static final String USER_USERID_IS_NOT_EMPTY = "user_userid_is_not_empty"; + public static final String USER_OLD_PASSWORD_IS_NOT_EMPTY = "user_old_password_is_not_empty"; + public static final String USER_NEW_PASSWORD_IS_NOT_EMPTY = "user_new_password_is_not_empty"; + public static final String USER_NEW_REPASSWORD_IS_NOT_EMPTY = "user_new_repassword_is_not_empty"; + public static final String USER_NEW_REPASSWORD_IS_NOT_EQUALS = "user_new_repassword_is_not_equals"; + public static final String USER_SAVE_IS_FAILED = "user_save_is_failed"; + public static final String USER_SAVE_IS_SUCCESS = "user_save_is_success"; + public static final String USER_SAVE_IS_EXIST = "user_is_exist"; + public static final String USER_LOGINID_IS_FAILED = "user_loginid_is_failed"; + public static final String USER_INFO_CHANGE_SUCCESS = "user_info_change_success"; + public static final String USER_IS_SUCCESS = "user_is_success"; + public static final String USER_TITLE_NAME_INSERT = "user_title_name_insert"; + public static final String USER_TITLE_NAME_MODIFY = "user_title_name_modify"; + public static final String USER_NAME_IS_NOT_EMPTY = "user_name_is_not_empty"; + public static final String USER_GET_LIST_IS_FAILED = "user_get_list_is_failed"; + public static final String USER_DELETE_FAILED = "user_delete_failed"; + public static final String USER_MAILADDRESS_IS_NOT_EQUALS = "user_mailaddress_is_not_equals"; + public static final String USER_REPASSWORD_ERROR = "user_repassword_error"; + public static final String USER_PASSWORD_ERROR = "user_password_error"; + /** ▲▲▲▲▲▲▲▲▲▲ user ▲▲▲▲▲▲▲▲▲▲ */ + + /** ▼▼▼▼▼▼▼▼▼▼ app ▼▼▼▼▼▼▼▼▼▼ */ + public static final String APP_APPNAME_IS_NOT_EMPTY = "app_appname_is_not_empty"; + public static final String APP_DEVICETYPE_IS_NOT_EMPTY = "app_DeviceType_is_not_empty"; + public static final String APP_VERSIONNAME_IS_NOT_EMPTY = "app_versionname_is_not_empty"; + public static final String APP_TYPEID_IS_NOT_EMPTY = "app_typeid_is_not_empty"; + public static final String APP_FILEPATH_IS_NOT_EMPTY = "app_filepath_is_not_empty"; + public static final String APP_ABSTRACT_IS_NOT_EMPTY = "app_abstract_is_not_empty"; + public static final String APP_IMAGRPATH_IS_NOT_EMPTY = "app_imagepath_is_not_empty"; + public static final String APP_SAVE_IS_FAILED = "app_save_is_failed"; + public static final String APP_SAVE_IS_SUCCESS = "app_save_is_success"; + public static final String APP_UPLOAD_PARAM_FILE_IS_NULL = "app_upload_param_file_is_null"; + public static final String APP_UPLOAD_MD5 = "md5_failed"; + public static final String APP_TITLE_NAME_MODIFY = "app_title_name_modify"; + public static final String APP_TITLE_NAME_INSERT = "app_title_name_insert"; + public static final String APP_APPNAME_MAX_ERROR = "app_appname_max_error"; + public static final String APP_FILEPATH_MAX_ERROR = "app_filepath_max_error"; + public static final String APP_VERSIONNAME_MAX_ERROR = "app_versionname_max_error"; + public static final String APP_ABSTRACT_MAX_ERROR = "app_abstract_max_error"; + public static final String APP_FILE_TYPE_IS_UNSUPPORTED = "app_file_type_is_unsupported"; + public static final String APP_FILE_READ_FAILED = "app_file_read_failed"; + public static final String APP_FILE_UNCOMPRESS_FAILED = "app_file_uncompress_failed"; + /** ▲▲▲▲▲▲▲▲▲▲ app ▲▲▲▲▲▲▲▲▲▲ */ + + /** ▼▼▼▼▼▼▼▼▼▼ authority ▼▼▼▼▼▼▼▼▼▼ */ + public static final String AUTHORITY_ID_IS_NOT_EMPTY = "authority_id_is_not_empty"; + /** ▼▼▼▼▼▼▼▼▼▼ authority ▼▼▼▼▼▼▼▼▼▼ */ + + /** ▼▼▼▼▼▼▼▼▼▼ system ▼▼▼▼▼▼▼▼▼▼ */ + public static final String SYS_ERROR_SAVE_SUCCESS = "sys_error_save_success"; + /** ▼▼▼▼▼▼▼▼▼▼ system ▼▼▼▼▼▼▼▼▼▼ */ + + +} diff --git a/appmarket-utils/src/main/java/app/market/utils/property/MessageUtil.java b/appmarket-utils/src/main/java/app/market/utils/property/MessageUtil.java new file mode 100644 index 0000000..e3bdfc2 --- /dev/null +++ b/appmarket-utils/src/main/java/app/market/utils/property/MessageUtil.java @@ -0,0 +1,55 @@ +/* + * Copyright (c) 2019 TOYOTA MOTOR CORPORATION + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package app.market.utils.property; + +import java.io.FileNotFoundException; +import java.io.IOException; +import java.io.InputStreamReader; +import java.util.Properties; + +import app.market.utils.constants.Constants; + +public class MessageUtil { + + public static Properties prop = null; + public static String i18n = Constants.I18N_JA_JP; + + private static Properties getPropertyInstance() { + if ( prop == null ) { + prop = new Properties(); + try { + prop.load( new InputStreamReader( MessageUtil.class.getClassLoader().getResourceAsStream( "message." + i18n + ".properties" ), "UTF-8" ) ); + } catch ( FileNotFoundException e ) { + throw new RuntimeException(); + } catch ( IOException e ) { + throw new RuntimeException(); + } + } + return MessageUtil.prop; + } + + /** + * Get propertites + * + * @param type + * @return String + */ + public static String getPropertites(String type) { + prop = getPropertyInstance(); + return prop.getProperty( type ); + } + +} diff --git a/appmarket-utils/src/main/java/app/market/utils/property/Option.java b/appmarket-utils/src/main/java/app/market/utils/property/Option.java new file mode 100644 index 0000000..eb8413e --- /dev/null +++ b/appmarket-utils/src/main/java/app/market/utils/property/Option.java @@ -0,0 +1,78 @@ +/* + * Copyright (c) 2019 TOYOTA MOTOR CORPORATION + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package app.market.utils.property; + +import java.io.Serializable; + +/** + * Page select's option + * + * @author Toyota + */ +public class Option implements Serializable, Comparable