1
1
"""
2
- Copyright (c) 2017, 2018 , Oracle and/or its affiliates. All rights reserved.
2
+ Copyright (c) 2017, 2019 , Oracle and/or its affiliates. All rights reserved.
3
3
The Universal Permissive License (UPL), Version 1.0
4
4
"""
5
-
6
- import wlsdeploy .util .dictionary_utils as dictionary_utils
5
+ from java .io import File
6
+ from oracle .weblogic .deploy .util import WLSDeployArchive
7
+ from shutil import copy
7
8
8
9
from wlsdeploy .aliases .model_constants import DOMAIN_LIBRARIES
9
- from wlsdeploy .aliases .model_constants import RCU_DB_INFO
10
10
from wlsdeploy .exception import exception_helper
11
11
from wlsdeploy .tool .util .alias_helper import AliasHelper
12
12
from wlsdeploy .tool .util .archive_helper import ArchiveHelper
13
13
from wlsdeploy .tool .util .wlst_helper import WlstHelper
14
14
15
+ import wlsdeploy .util .dictionary_utils as dictionary_utils
16
+
15
17
16
18
class LibraryHelper (object ):
17
19
"""
@@ -51,9 +53,14 @@ def install_domain_libraries(self):
51
53
raise ex
52
54
53
55
for domain_lib in domain_libs :
54
- self .logger .info ('WLSDPLY-12215' , domain_lib , self .domain_home ,
55
- class_name = self .__class_name , method_name = _method_name )
56
- self .archive_helper .extract_domain_library (domain_lib )
56
+ if WLSDeployArchive .isPathIntoArchive (domain_lib ):
57
+ self .logger .info ('WLSDPLY-12215' , domain_lib , self .domain_home ,
58
+ class_name = self .__class_name , method_name = _method_name )
59
+ self .archive_helper .extract_domain_library (domain_lib )
60
+ else :
61
+ self .logger .info ('WLSDPLY-12235' , domain_lib , self .domain_home ,
62
+ class_name = self .__class_name , method_name = _method_name )
63
+ self ._copy_domain_library (domain_lib )
57
64
58
65
self .logger .exiting (class_name = self .__class_name , method_name = _method_name )
59
66
return
@@ -78,3 +85,20 @@ def extract_classpath_libraries(self):
78
85
class_name = self .__class_name , method_name = _method_name )
79
86
self .logger .exiting (class_name = self .__class_name , method_name = _method_name )
80
87
return
88
+
89
+ def _copy_domain_library (self , domain_lib ):
90
+ """
91
+ Copy the specified domain library to the domain's lib directory.
92
+ :raises: BundleAwareException of the specified type: if an error occurs
93
+ """
94
+ _method_name = '_copy_domain_library'
95
+
96
+ source_path = File (domain_lib ).getAbsolutePath ()
97
+ target_dir = File (self .domain_home , 'lib' ).getPath ()
98
+
99
+ try :
100
+ copy (str (source_path ), str (target_dir ))
101
+ except IOError :
102
+ ex = exception_helper .create_create_exception ('WLSDPLY-12234' , source_path , target_dir )
103
+ self .logger .throwing (ex , class_name = self .__class_name , method_name = _method_name )
104
+ raise ex
0 commit comments