summaryrefslogtreecommitdiffstats
path: root/warehouse/src/main/java/app/market/PropertyTool.java
diff options
context:
space:
mode:
authorzheng_wenlong <wenlong_zheng@nexty-ele.com>2019-04-16 11:20:38 +0900
committerzheng_wenlong <wenlong_zheng@nexty-ele.com>2019-05-13 17:50:04 +0900
commit3b55d06b89bf64873e685c3d78fce5affbba3d17 (patch)
tree2adcff0087f4757107d2bf1e50c85ea649f04f94 /warehouse/src/main/java/app/market/PropertyTool.java
[Patch Set 2] Add ReadMe.md Change-Id: I6ade52d2490f5ca4ba107c1a27ed6d5b39048725 Signed-off-by: zheng_wenlong <wenlong_zheng@nexty-ele.com>
Diffstat (limited to 'warehouse/src/main/java/app/market/PropertyTool.java')
-rw-r--r--warehouse/src/main/java/app/market/PropertyTool.java55
1 files changed, 55 insertions, 0 deletions
diff --git a/warehouse/src/main/java/app/market/PropertyTool.java b/warehouse/src/main/java/app/market/PropertyTool.java
new file mode 100644
index 0000000..24f2cda
--- /dev/null
+++ b/warehouse/src/main/java/app/market/PropertyTool.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;
+
+import java.io.FileNotFoundException;
+import java.io.IOException;
+import java.io.InputStreamReader;
+import java.util.Properties;
+
+import app.market.utils.constants.Constants;
+
+
+public class PropertyTool {
+
+ public static Properties prop;
+
+ private static Properties getPropertyInstance() {
+ if ( prop == null ) {
+ prop = new Properties();
+ try {
+ prop.load( new InputStreamReader(
+ PropertyTool.class.getClassLoader().getResourceAsStream( Constants.PROPERTIES_FILE_NAME_PROPERTIES ), Constants.CHARACTER_UTF8 ) );
+ } catch ( FileNotFoundException e ) {
+ throw new RuntimeException();
+ } catch ( IOException e ) {
+ throw new RuntimeException();
+ }
+ }
+ return PropertyTool.prop;
+ }
+
+ /**
+ * get propertites
+ *
+ * @param type
+ * @return String
+ */
+ public static String getPropertites(String type) {
+ prop = getPropertyInstance();
+ return prop.getProperty( type );
+ }
+}
'#n401'>401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646