in o2a/utils/file_archive_extractors.py [0:0]
def _check_archive_extensions(self, oozie_archive_path: str) -> List[str]:
"""
Checks if the archive path is correct archive path.
:param oozie_archive_path: path to check
:return: path split on hash
"""
split_path = split_by_hash_sign(oozie_archive_path)
archive_path = split_path[0]
extension_accepted = False
for extension in self.ALLOWED_EXTENSIONS:
if archive_path.endswith(extension):
extension_accepted = True
if not extension_accepted:
raise Exception(
"The path {} cannot be accepted as archive as it does not have one "
"of the extensions: {}".format(archive_path, self.ALLOWED_EXTENSIONS)
)
return split_path