From: Vásáry Dániel Date: Tue, 24 Jul 2018 12:11:23 +0000 (+0000) Subject: git-tfs-id: [http://tfs.userrendszerhaz.hu:8080/tfs/DefaultCollection]$/MediaCube... X-Git-Url: http://git.useribm.hu/?a=commitdiff_plain;h=6a29672ec1c4d82b75edd0443cdbad587ad084a2;p=mediacube.git git-tfs-id: [tfs.userrendszerhaz.hu:8080/tfs/DefaultCollection]$/MediaCube;C31215 --- diff --git a/client/Maestro/Configuration/UJ-configuration-tqc-check.json b/client/Maestro/Configuration/UJ-configuration-tqc-check.json index 765596cc..d655bfec 100644 --- a/client/Maestro/Configuration/UJ-configuration-tqc-check.json +++ b/client/Maestro/Configuration/UJ-configuration-tqc-check.json @@ -12,13 +12,13 @@ "$type": "UNCSource", "filter": "avi,wav,mxf", "local": { - "address": "file://c:/_video", + "address": "file://10.10.1.100/BRAAVOS/ARCHIVE/ONE", "userName": "mediacube", "password": "Dn8t4gfHcK98o8hyPgLDhr5SgSji4JCxsfpMJsODikUp3nXgrM0UNCi45lLAK8ZOnmEneO44P9qpJ4QDqhctN6MxZodjJgdZTyoZKmSa+ECzEzLr/wPYNgxVaXrVotEy", "timeout": 1000 }, "remote": { - "address": "ftp://10.10.1.100/TQC/CHECK", + "address": "ftp://10.10.1.100/ARCHIVE/ONE", "userName": "mediacube", "password": "Dn8t4gfHcK98o8hyPgLDhr5SgSji4JCxsfpMJsODikUp3nXgrM0UNCi45lLAK8ZOnmEneO44P9qpJ4QDqhctN6MxZodjJgdZTyoZKmSa+ECzEzLr/wPYNgxVaXrVotEy", "timeout": 1000 @@ -82,14 +82,14 @@ }, { "label": "Archiválás", - "processor": "UNCTargetProcessor", + "processor": "FTPTargetProcessor", "outputFormat": "%ID%", "tag": "Archiválás", "saveArchiveMetadata": true, "disableFileVersioning": true, "enableOverride": true, "remote": { - "address": "file://10.10.1.100/BRAAVOS/ARCHIVE", + "address": "ftp://10.10.1.100/ARCHIVE/ONE", "userName": "mediacube", "password": "Dn8t4gfHcK98o8hyPgLDhr5SgSji4JCxsfpMJsODikUp3nXgrM0UNCi45lLAK8ZOnmEneO44P9qpJ4QDqhctN6MxZodjJgdZTyoZKmSa+ECzEzLr/wPYNgxVaXrVotEy", "timeout": 1000 diff --git a/client/Maestro/Configuration/-configuration-nexio-ingest.json b/client/Maestro/Configuration/configuration-nexio-ingest.json similarity index 88% rename from client/Maestro/Configuration/-configuration-nexio-ingest.json rename to client/Maestro/Configuration/configuration-nexio-ingest.json index fbb58f35..187185c5 100644 --- a/client/Maestro/Configuration/-configuration-nexio-ingest.json +++ b/client/Maestro/Configuration/configuration-nexio-ingest.json @@ -12,13 +12,7 @@ "$type": "UNCSource", "filter": "avi,wav,mxf", "local": { - "address": "file://10.10.1.100/BRAAVOS/READY", - "userName": "mediacube", - "password": "Dn8t4gfHcK98o8hyPgLDhr5SgSji4JCxsfpMJsODikUp3nXgrM0UNCi45lLAK8ZOnmEneO44P9qpJ4QDqhctN6MxZodjJgdZTyoZKmSa+ECzEzLr/wPYNgxVaXrVotEy", - "timeout": 1000 - }, - "remote": { - "address": "ftp://10.10.1.100/READY", + "address": "file://c:\\_video", "userName": "mediacube", "password": "Dn8t4gfHcK98o8hyPgLDhr5SgSji4JCxsfpMJsODikUp3nXgrM0UNCi45lLAK8ZOnmEneO44P9qpJ4QDqhctN6MxZodjJgdZTyoZKmSa+ECzEzLr/wPYNgxVaXrVotEy", "timeout": 1000 @@ -83,7 +77,6 @@ "killDateDays": 7, "disableFileVersioning": true, "agency": "MAESTRO-EDITOR", - "reference": [ "Octopus mappába küldés" ], "remote": { "address": "ftp://10.10.1.55:2098", "userName": "administrator", diff --git a/client/Maestro/Maestro.csproj b/client/Maestro/Maestro.csproj index c6cda3bc..8a3fe707 100644 --- a/client/Maestro/Maestro.csproj +++ b/client/Maestro/Maestro.csproj @@ -281,7 +281,7 @@ Always - + Always diff --git a/client/MaestroShared/Targets/FTPTargetProcessor.cs b/client/MaestroShared/Targets/FTPTargetProcessor.cs index 6778ff72..4cf88f19 100644 --- a/client/MaestroShared/Targets/FTPTargetProcessor.cs +++ b/client/MaestroShared/Targets/FTPTargetProcessor.cs @@ -6,6 +6,7 @@ using System; using System.IO; using System.Linq; using System.Net; +using System.Text; using System.Windows.Forms; namespace MaestroShared.Targets { @@ -14,7 +15,9 @@ namespace MaestroShared.Targets { private const string PATTERN_CONCAT = "{0}{1}"; private const string _226 = "226"; private const string UPLOAD_ERROR = "Feltöltési hiba."; - 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."; + private const string _200 = "200"; + private const string SITE0011 = "SITE 0011"; + private const string _1211 = "1211"; private readonly Logger logger = LogManager.GetCurrentClassLogger(); protected FtpClient targetFTP; @@ -45,11 +48,31 @@ namespace MaestroShared.Targets { //Input = inputUri.ToString(); } + + protected bool IsNexioServer(FtpClient ftpClient) { + bool result = false; + //Device Type Request + FtpReply reply = targetFTP.Execute(SITE0011); + if (_200.Equals(reply.Code)) + result = reply.Message != null && reply.Message.Contains(_1211); + return result; + } + protected override void BeforeExecute() { base.BeforeExecute(); targetFTP = CreateClient(Parameters.TargetConfig.Remote); } + + protected override void ValidateTransfer() { + if (!IsNexioServer(targetFTP)) { + long sourceSize = inputFile.Length; + long uploadedSize = targetFTP.GetFileSize(OutputName); + if (sourceSize != uploadedSize) + throw new Exception(UPLOAD_ERROR); + } + } + protected override void AfterExecute() { base.AfterExecute(); TerminateClient(targetFTP); @@ -89,10 +112,6 @@ namespace MaestroShared.Targets { FtpReply reply = targetFTP.GetReply(); if (!reply.Success || !_226.Equals(reply.Code)) throw new Exception(UPLOAD_ERROR); - //long sourceSize = inputFile.Length; - //long uploadedSize = targetFTP.GetFileSize(OutputName); - //if (sourceSize != uploadedSize) - // throw new Exception(UPLOAD_SIZE_ERROR); } protected override void UploadContent(string outputPath, byte[] content) { diff --git a/client/MaestroShared/Targets/UNCTargetProcessor.cs b/client/MaestroShared/Targets/UNCTargetProcessor.cs index a151ac04..9b8ff2e8 100644 --- a/client/MaestroShared/Targets/UNCTargetProcessor.cs +++ b/client/MaestroShared/Targets/UNCTargetProcessor.cs @@ -37,7 +37,7 @@ namespace MaestroShared.Targets { protected const string HYPHEN = "-"; protected const string SLASH = "/"; protected const string BACKSLASH = @"\"; - 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."; + 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."; private const string STAR = "*"; protected FileInfo inputFile; protected string workingDir; @@ -89,6 +89,7 @@ namespace MaestroShared.Targets { string currentFile = GetOutputFilePath(workingDir, OutputName); if (DeleteExisting(currentFile)) { UploadFile(); + ValidateTransfer(); //logger.Info("Spend (s):" + (DateTime.Now - started).TotalSeconds); Status = READY; Message = SUCCESS; @@ -111,6 +112,13 @@ namespace MaestroShared.Targets { return result; } + protected virtual void ValidateTransfer() { + long sourceSize = inputFile.Length; + long uploadedSize = new FileInfo(Output).Length; + if (sourceSize != uploadedSize) + throw new Exception(COPY_SIZE_ERROR); + } + protected virtual void CreateOutput(string workingDir) { Output = SLASH.Equals(workingDir) ? OutputName : Path.Combine(workingDir, OutputName); } @@ -382,10 +390,6 @@ namespace MaestroShared.Targets { protected virtual void UploadFile() { int pbCancel = 0; Win32File.CopyFileEx(Input, Output, new CopyProgressRoutine(this.CopyProgressHandler), IntPtr.Zero, ref pbCancel, CopyFileFlags.COPY_FILE_RESTARTABLE); - //long sourceSize = inputFile.Length; - //long uploadedSize = new FileInfo(Output).Length; - //if (sourceSize != uploadedSize) - // throw new Exception(COPY_SIZE_ERROR); } protected virtual string GetOutputFilePath(string path, string fileName) { diff --git a/server/user.jobengine.osgi.server/test/user/jobengine/server/IT/Support.java b/server/user.jobengine.osgi.server/test/user/jobengine/server/IT/Support.java index e14bc223..262abe82 100644 --- a/server/user.jobengine.osgi.server/test/user/jobengine/server/IT/Support.java +++ b/server/user.jobengine.osgi.server/test/user/jobengine/server/IT/Support.java @@ -612,4 +612,12 @@ public class Support { } + @Test + public void test2() throws Exception { + Item i = manager.createItem("Generic", "Gyűjtő elgekko", "Gyűjtő elgekko", "100000"); + Media m = manager.createMedia("Generic", "Média elgekko", "Média elgekko", "200000"); + manager.add(i); + m.setItemId(i.getId()); + manager.add(m); + } }