//[TestMethod()] public async Task InitTestDirectory() { try { DropBoxBase dropboxBase = new DropBoxBase(); await dropboxBase.CreateFolder("dir1"); await dropboxBase.CreateFolder("dir2"); var mathImgPath = "F:/Imagens/math.jpg"; var bugDeadImgPath = "F:/Imagens/testcase.png"; var especPdfPath = "C:/Users/Usuário/Downloads/Enunciado.pdf"; await dropboxBase.Upload("dir1/math.jpg", mathImgPath); await dropboxBase.Upload("dir2/trab_teste_sw.pdf", especPdfPath); await dropboxBase.Upload(Path.GetFileName(bugDeadImgPath), bugDeadImgPath); dropboxBase.Close(); } catch (Exception e) { Console.Write(e.ToString()); } }
public static void Export(CadSysContext context, DropBoxBase dropBoxClient, string ai, string ap, string f, string o) { dropBoxClient.Delete(o); dropBoxClient.CreateFolder(o); CreateOutputDir(); var fise = dropBoxClient.ListFolder(f, false, true, ".pdf"); //Parallel.ForEach(fise, new ParallelOptions { MaxDegreeOfParallelism = 4 }, x => fise.ToList().ForEach(x => { Pizdificator pizd; pizd = GatherFromContext(context, Path.GetFileNameWithoutExtension(x)); var files = GatherFromFiles(pizd, dropBoxClient, ai, ap, f); AggregateAndExport(dropBoxClient, $"{outputLocalDir}/{Path.GetFileName(x)}", o, files); }); }