<None Include="Configuration\global.json">\r
<CopyToOutputDirectory>Always</CopyToOutputDirectory>\r
</None>\r
- <None Include="Configuration\configuration-nexio-ingest.json">\r
+ <None Include="Configuration\-configuration-nexio-ingest.json">\r
<CopyToOutputDirectory>Always</CopyToOutputDirectory>\r
</None>\r
<None Include="Configuration\-configuration-editor.json">\r
<CopyToOutputDirectory>Always</CopyToOutputDirectory>\r
</None>\r
- <None Include="Configuration\-configuration-nle.json">\r
+ <None Include="Configuration\configuration-nle.json">\r
<CopyToOutputDirectory>Always</CopyToOutputDirectory>\r
</None>\r
<None Include="Configuration\-configuration-playout-ingest.json">\r
<None Include="Configuration\-configuration-tqc-check.json">\r
<CopyToOutputDirectory>Always</CopyToOutputDirectory>\r
</None>\r
- <None Include="Configuration\UJ-configuration-tqc-check.json">\r
+ <None Include="Configuration\-UJ-configuration-tqc-check.json">\r
<CopyToOutputDirectory>Always</CopyToOutputDirectory>\r
</None>\r
<None Include="Connected Services\packages.config" />\r
<None Include="Configuration\-configuration-sxs.json">\r
<CopyToOutputDirectory>Always</CopyToOutputDirectory>\r
</None>\r
- <None Include="Configuration\-configuration-studio.json">\r
+ <None Include="Configuration\configuration-studio.json">\r
<CopyToOutputDirectory>Always</CopyToOutputDirectory>\r
</None>\r
</ItemGroup>\r
using MaestroShared.Target;\r
using NLog;\r
using System;\r
-using System.Diagnostics;\r
using System.IO;\r
using System.Text.RegularExpressions;\r
using System.Threading;\r
private const string SPACE = " ";\r
private Logger logger = LogManager.GetCurrentClassLogger();\r
private Source sourceConfig;\r
+ private FtpClient sourceFTP = null;\r
+ private FtpClient monitorFTP = null;\r
+ private long sourceFileLength = 0;\r
+ private long uploadedFileLength = 0;\r
Uri inputUri;\r
\r
public override void Initialize(Control parent, TargetProcessorParameter parameters) {\r
}\r
\r
protected override void UploadFile() {\r
- FtpClient sourceFTP = null;\r
- FtpClient monitorFTP = null;\r
-\r
try {\r
sourceFTP = CreateClient(sourceConfig.Remote);\r
\r
+ logger.Info("1 " + IsNexioServer(sourceFTP));\r
+\r
string input = Uri.UnescapeDataString(inputUri.AbsolutePath);\r
- long ilength = sourceFTP.GetFileSize(input);\r
+ sourceFileLength = sourceFTP.GetFileSize(input);\r
if (Parameters.TargetConfig.NexioServer)\r
- ilength = ilength / 2;\r
+ sourceFileLength = sourceFileLength / 2;\r
+\r
+ logger.Info("2 " + IsNexioServer(sourceFTP));\r
\r
FtpReply replyPASV = targetFTP.Execute("PASV");\r
if (!replyPASV.Success)\r
if (!replyPORT.Success)\r
throw new Exception(replyPORT.ErrorMessage);\r
\r
+ logger.Info("3 " + IsNexioServer(sourceFTP));\r
+\r
\r
FtpReply sourceReplyTYPE = sourceFTP.Execute("TYPE I");\r
if (!sourceReplyTYPE.Success)\r
throw new Exception(sourceReplyTYPE.ErrorMessage);\r
\r
+ logger.Info("4 " + IsNexioServer(sourceFTP));\r
+\r
if (input.LastIndexOf("/") == 0)\r
input = input.Replace("/", "");\r
FtpReply replyRETR = sourceFTP.Execute("RETR " + input);\r
throw new Exception(replyRETR.ErrorMessage);\r
}\r
\r
+ logger.Info("5 " + IsNexioServer(sourceFTP));\r
+\r
FtpReply targetReplyTYPE = targetFTP.Execute("TYPE I");\r
if (!targetReplyTYPE.Success)\r
throw new Exception(targetReplyTYPE.ErrorMessage);\r
throw new Exception(targetReplyTYPE.ErrorMessage);\r
//if (!FileExists(OutputName))\r
// throw new Exception("A cél állomány nem jött létre.");\r
- long overall = 0;\r
long lastSize = 0;\r
- while (overall != ilength) {\r
- overall = monitorFTP.GetFileSize(OutputName);\r
+ while (uploadedFileLength != sourceFileLength) {\r
+ uploadedFileLength = monitorFTP.GetFileSize(OutputName);\r
/*\r
FtpReply statRETR = sourceFTP.Execute("STAT");\r
if (!statRETR.Success)\r
else\r
Debug.WriteLine($"Overall {overall}, last {lastSize} site {statRETR.Message}");\r
*/\r
- if (overall == lastSize && overall > 0) {\r
+ if (uploadedFileLength == lastSize && uploadedFileLength > 0) {\r
Progress = 100;\r
break;\r
} else {\r
- int currentProgress = (int)((double)overall / ilength * 100);\r
+ int currentProgress = (int)((double)uploadedFileLength / sourceFileLength * 100);\r
Progress = currentProgress > 100 ? 100 : currentProgress;\r
- lastSize = overall;\r
+ lastSize = uploadedFileLength;\r
}\r
Thread.Sleep(1000);\r
}\r
-\r
- /* Ezen még agyalni kell \r
- if (!Parameters.TargetConfig.NexioServer) {\r
- //-1 -et ad???\r
- long uploadedSize = targetFTP.GetFileSize(OutputName);\r
- if (ilength != uploadedSize)\r
- throw new Exception(UPLOAD_SIZE_ERROR);\r
- }\r
- */\r
}\r
catch (Exception e) {\r
throw e;\r
}\r
- finally {\r
- TerminateClient(monitorFTP);\r
- TerminateClient(sourceFTP);\r
- }\r
\r
//logger.Debug("Done");\r
}\r
\r
+ protected override void ValidateTransfer() {\r
+ if (!IsNexioServer(sourceFTP) && !IsNexioServer(monitorFTP)) {\r
+ if (sourceFileLength != uploadedFileLength)\r
+ throw new Exception(COPY_SIZE_ERROR);\r
+ }\r
+ }\r
+\r
+ protected override void AfterExecute() {\r
+ base.AfterExecute();\r
+ TerminateClient(monitorFTP);\r
+ TerminateClient(sourceFTP);\r
+ }\r
+\r
\r
}\r
}\r