11"""
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.
33The Universal Permissive License (UPL), Version 1.0
44"""
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
78
89from wlsdeploy .aliases .model_constants import DOMAIN_LIBRARIES
9- from wlsdeploy .aliases .model_constants import RCU_DB_INFO
1010from wlsdeploy .exception import exception_helper
1111from wlsdeploy .tool .util .alias_helper import AliasHelper
1212from wlsdeploy .tool .util .archive_helper import ArchiveHelper
1313from wlsdeploy .tool .util .wlst_helper import WlstHelper
1414
15+ import wlsdeploy .util .dictionary_utils as dictionary_utils
16+
1517
1618class LibraryHelper (object ):
1719 """
@@ -51,9 +53,14 @@ def install_domain_libraries(self):
5153 raise ex
5254
5355 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 )
5764
5865 self .logger .exiting (class_name = self .__class_name , method_name = _method_name )
5966 return
@@ -78,3 +85,20 @@ def extract_classpath_libraries(self):
7885 class_name = self .__class_name , method_name = _method_name )
7986 self .logger .exiting (class_name = self .__class_name , method_name = _method_name )
8087 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