Fixed ftp file or folder check

Changes:
- fixed issue where it couldn't detect if it would be a file or folder with ftp
This commit is contained in:
Neocky 2021-08-01 15:06:55 +02:00
parent 367ee5be42
commit 1ff34a7372

View File

@ -100,11 +100,17 @@ def ftp_downloadFile(ftp, downloadPath, fileToDownload):
ftp.quit() ftp.quit()
def ftp_validateFileAttributes(ftp, pluginPath): def ftp_is_file(FTP, pluginPath):
pluginFTPAttribute = ftp.lstat(pluginPath) if FTP.nlst(pluginPath) == [pluginPath]:
if stat.S_ISDIR(pluginFTPAttribute.st_mode): return True
return False else:
elif re.search(r'.jar$', pluginPath): return False
def ftp_validateFileAttributes(ftp, pluginPath):
if ftp_is_file(ftp, pluginPath) is False:
return False
if re.search(r'.jar$', pluginPath):
return True return True
else: else:
return False return False