EquipmentList.OrderBy
This commit is contained in:
@@ -50,8 +50,19 @@ namespace JWH.NETWORK
|
||||
|
||||
public static bool IsFileExists(string path)
|
||||
{
|
||||
Connect();
|
||||
return _sftpClient.Exists(path);
|
||||
try
|
||||
{
|
||||
Connect();
|
||||
return _sftpClient.Exists(path);
|
||||
}
|
||||
catch
|
||||
{
|
||||
return false;
|
||||
}
|
||||
finally
|
||||
{
|
||||
Disconnect();
|
||||
}
|
||||
}
|
||||
|
||||
public static Renci.SshNet.Sftp.SftpFileAttributes GetFileInfo(string remoteFilePath)
|
||||
@@ -74,12 +85,27 @@ namespace JWH.NETWORK
|
||||
Console.WriteLine($"파일 정보 조회 오류: {ex.Message}");
|
||||
return null;
|
||||
}
|
||||
finally
|
||||
{
|
||||
Disconnect();
|
||||
}
|
||||
}
|
||||
|
||||
public static object GetSftpList(string path)
|
||||
{
|
||||
Connect();
|
||||
return _sftpClient.ListDirectory(path);
|
||||
try
|
||||
{
|
||||
Connect();
|
||||
return _sftpClient.ListDirectory(path);
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
throw ex;
|
||||
}
|
||||
finally
|
||||
{
|
||||
Disconnect();
|
||||
}
|
||||
}
|
||||
|
||||
public static bool DownloadSftpFile(string remotePath, string localPath)
|
||||
@@ -98,6 +124,10 @@ namespace JWH.NETWORK
|
||||
Console.WriteLine($"Download error: {ex.Message}");
|
||||
return false;
|
||||
}
|
||||
finally
|
||||
{
|
||||
Disconnect();
|
||||
}
|
||||
}
|
||||
|
||||
public static bool UploadSftpFile(string localPath, string remotePath)
|
||||
@@ -116,6 +146,10 @@ namespace JWH.NETWORK
|
||||
Console.WriteLine($"Upload error: {ex.Message}");
|
||||
return false;
|
||||
}
|
||||
finally
|
||||
{
|
||||
Disconnect();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user