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()
def ftp_validateFileAttributes(ftp, pluginPath):
pluginFTPAttribute = ftp.lstat(pluginPath)
if stat.S_ISDIR(pluginFTPAttribute.st_mode):
return False
elif re.search(r'.jar$', pluginPath):
def ftp_is_file(FTP, pluginPath):
if FTP.nlst(pluginPath) == [pluginPath]:
return True
else:
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
else:
return False