public Automatic(string scanDir, Manifest manifest) { this.scanDir = scanDir; this.manifest = manifest; this.fataphat = new FaTaPhat(); this.Initialize(); }
public Manifest(string scanDir) { manifest = new NameValueCollection(); leftovers = scanDir + "/" + filename; if (File.Exists(leftovers)) { this.LoadFile(leftovers); } fataphat = new FaTaPhat(); }
public void Process(FaTaPhat fataphat) { string rightSideUp, upsideDown; int length = nameInStaging.Length; rightSideUp = nameInStaging.Substring(0, length - 1) + "0"; upsideDown = nameInStaging.Substring(0, length - 1) + "1"; // We receive a scan only once, ALWAYS check if // scan is already in the bank (locker or staging) if (fataphat.Exists(nameInLocker) || fataphat.Exists(rightSideUp) || fataphat.Exists(upsideDown)) { File.Delete(scanFile); } else { if (fataphat.Put(scanFile, nameInStaging, FtpDataType.Binary)) { File.Delete(scanFile); } else { throw new Exception("N/w issue? File transfer (PUT) failed"); } } }