"$type": "UNCSource",\r
"filter": "avi,wav,mxf",\r
"local": {\r
- "address": "file://c:/_video",\r
+ "address": "file://10.10.1.100/BRAAVOS/ARCHIVE/ONE",\r
"userName": "mediacube",\r
"password": "Dn8t4gfHcK98o8hyPgLDhr5SgSji4JCxsfpMJsODikUp3nXgrM0UNCi45lLAK8ZOnmEneO44P9qpJ4QDqhctN6MxZodjJgdZTyoZKmSa+ECzEzLr/wPYNgxVaXrVotEy",\r
"timeout": 1000\r
},\r
"remote": {\r
- "address": "ftp://10.10.1.100/TQC/CHECK",\r
+ "address": "ftp://10.10.1.100/ARCHIVE/ONE",\r
"userName": "mediacube",\r
"password": "Dn8t4gfHcK98o8hyPgLDhr5SgSji4JCxsfpMJsODikUp3nXgrM0UNCi45lLAK8ZOnmEneO44P9qpJ4QDqhctN6MxZodjJgdZTyoZKmSa+ECzEzLr/wPYNgxVaXrVotEy",\r
"timeout": 1000\r
},\r
{\r
"label": "Archiválás",\r
- "processor": "UNCTargetProcessor",\r
+ "processor": "FTPTargetProcessor",\r
"outputFormat": "%ID%",\r
"tag": "Archiválás",\r
"saveArchiveMetadata": true,\r
"disableFileVersioning": true,\r
"enableOverride": true,\r
"remote": {\r
- "address": "file://10.10.1.100/BRAAVOS/ARCHIVE",\r
+ "address": "ftp://10.10.1.100/ARCHIVE/ONE",\r
"userName": "mediacube",\r
"password": "Dn8t4gfHcK98o8hyPgLDhr5SgSji4JCxsfpMJsODikUp3nXgrM0UNCi45lLAK8ZOnmEneO44P9qpJ4QDqhctN6MxZodjJgdZTyoZKmSa+ECzEzLr/wPYNgxVaXrVotEy",\r
"timeout": 1000\r
"$type": "UNCSource",\r
"filter": "avi,wav,mxf",\r
"local": {\r
- "address": "file://10.10.1.100/BRAAVOS/READY",\r
- "userName": "mediacube",\r
- "password": "Dn8t4gfHcK98o8hyPgLDhr5SgSji4JCxsfpMJsODikUp3nXgrM0UNCi45lLAK8ZOnmEneO44P9qpJ4QDqhctN6MxZodjJgdZTyoZKmSa+ECzEzLr/wPYNgxVaXrVotEy",\r
- "timeout": 1000\r
- },\r
- "remote": {\r
- "address": "ftp://10.10.1.100/READY",\r
+ "address": "file://c:\\_video",\r
"userName": "mediacube",\r
"password": "Dn8t4gfHcK98o8hyPgLDhr5SgSji4JCxsfpMJsODikUp3nXgrM0UNCi45lLAK8ZOnmEneO44P9qpJ4QDqhctN6MxZodjJgdZTyoZKmSa+ECzEzLr/wPYNgxVaXrVotEy",\r
"timeout": 1000\r
"killDateDays": 7,\r
"disableFileVersioning": true,\r
"agency": "MAESTRO-EDITOR",\r
- "reference": [ "Octopus mappába küldés" ],\r
"remote": {\r
"address": "ftp://10.10.1.55:2098",\r
"userName": "administrator",\r
<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
using System.IO;\r
using System.Linq;\r
using System.Net;\r
+using System.Text;\r
using System.Windows.Forms;\r
\r
namespace MaestroShared.Targets {\r
private const string PATTERN_CONCAT = "{0}{1}";\r
private const string _226 = "226";\r
private const string UPLOAD_ERROR = "Feltöltési hiba.";\r
- protected const string UPLOAD_SIZE_ERROR = "Feltöltési hiba, a feltöltött fájl mérete nem egyezik a forrásfájl méretével.";\r
+ private const string _200 = "200";\r
+ private const string SITE0011 = "SITE 0011";\r
+ private const string _1211 = "1211";\r
private readonly Logger logger = LogManager.GetCurrentClassLogger();\r
protected FtpClient targetFTP;\r
\r
//Input = inputUri.ToString();\r
}\r
\r
+\r
+ protected bool IsNexioServer(FtpClient ftpClient) {\r
+ bool result = false;\r
+ //Device Type Request\r
+ FtpReply reply = targetFTP.Execute(SITE0011);\r
+ if (_200.Equals(reply.Code))\r
+ result = reply.Message != null && reply.Message.Contains(_1211);\r
+ return result;\r
+ }\r
+\r
protected override void BeforeExecute() {\r
base.BeforeExecute();\r
targetFTP = CreateClient(Parameters.TargetConfig.Remote);\r
}\r
\r
+\r
+ protected override void ValidateTransfer() {\r
+ if (!IsNexioServer(targetFTP)) {\r
+ long sourceSize = inputFile.Length;\r
+ long uploadedSize = targetFTP.GetFileSize(OutputName);\r
+ if (sourceSize != uploadedSize)\r
+ throw new Exception(UPLOAD_ERROR);\r
+ }\r
+ }\r
+\r
protected override void AfterExecute() {\r
base.AfterExecute();\r
TerminateClient(targetFTP);\r
FtpReply reply = targetFTP.GetReply();\r
if (!reply.Success || !_226.Equals(reply.Code))\r
throw new Exception(UPLOAD_ERROR);\r
- //long sourceSize = inputFile.Length;\r
- //long uploadedSize = targetFTP.GetFileSize(OutputName);\r
- //if (sourceSize != uploadedSize)\r
- // throw new Exception(UPLOAD_SIZE_ERROR);\r
}\r
\r
protected override void UploadContent(string outputPath, byte[] content) {\r
protected const string HYPHEN = "-";\r
protected const string SLASH = "/";\r
protected const string BACKSLASH = @"\";\r
- private const string COPY_SIZE_ERROR = "Másolási hiba, a másolt fájl mérete nem egyezik a forrásfájl méretével.";\r
+ protected const string COPY_SIZE_ERROR = "Másolási hiba, a másolt fájl mérete nem egyezik a forrásfájl méretével.";\r
private const string STAR = "*";\r
protected FileInfo inputFile;\r
protected string workingDir;\r
string currentFile = GetOutputFilePath(workingDir, OutputName);\r
if (DeleteExisting(currentFile)) {\r
UploadFile();\r
+ ValidateTransfer();\r
//logger.Info("Spend (s):" + (DateTime.Now - started).TotalSeconds);\r
Status = READY;\r
Message = SUCCESS;\r
return result;\r
}\r
\r
+ protected virtual void ValidateTransfer() {\r
+ long sourceSize = inputFile.Length;\r
+ long uploadedSize = new FileInfo(Output).Length;\r
+ if (sourceSize != uploadedSize)\r
+ throw new Exception(COPY_SIZE_ERROR);\r
+ }\r
+\r
protected virtual void CreateOutput(string workingDir) {\r
Output = SLASH.Equals(workingDir) ? OutputName : Path.Combine(workingDir, OutputName);\r
}\r
protected virtual void UploadFile() {\r
int pbCancel = 0;\r
Win32File.CopyFileEx(Input, Output, new CopyProgressRoutine(this.CopyProgressHandler), IntPtr.Zero, ref pbCancel, CopyFileFlags.COPY_FILE_RESTARTABLE);\r
- //long sourceSize = inputFile.Length;\r
- //long uploadedSize = new FileInfo(Output).Length;\r
- //if (sourceSize != uploadedSize)\r
- // throw new Exception(COPY_SIZE_ERROR);\r
}\r
\r
protected virtual string GetOutputFilePath(string path, string fileName) {\r
\r
}\r
\r
+ @Test\r
+ public void test2() throws Exception {\r
+ Item i = manager.createItem("Generic", "Gyűjtő elgekko", "Gyűjtő elgekko", "100000");\r
+ Media m = manager.createMedia("Generic", "Média elgekko", "Média elgekko", "200000");\r
+ manager.add(i);\r
+ m.setItemId(i.getId());\r
+ manager.add(m);\r
+ }\r
}\r