private GridJobFile LoadJobFile(string path, EGridJobFileDirection dir, EGridJobFileShare share)
        {
            if (!File.Exists(path))
            {
                throw new Exception($"No such file {path}, you need to pass full path, not relative");
            }

            return(GridJobFile.ImportFromExternal(path, dir, share));
        }
Beispiel #2
0
        public static GridJobFile ImportFromExternal(string input, EGridJobFileDirection dir, EGridJobFileShare share)
        {
            if (!File.Exists(input))
            {
                throw new Exception($"No such file {input}, you need to pass full path, not relative");
            }

            var file = new GridJobFile {
                FileName  = Path.GetFileName(input),
                InputPath = input,
                Direction = dir,
                ShareMode = share,
                Bytes     = File.ReadAllBytes(input)
            };

            file.CheckSum = CryptoUtils.CrcOfBytes(file.Bytes);
            return(file);
        }