示例#1
0
 public void PrepareTargetFile(string targetFileSpec)
 {
     TargetFiler.PathCheck(targetFileSpec);
     if (TargetFiler.FileExists(targetFileSpec))
     {
         TargetFiler.DeleteFile(targetFileSpec);
     }
 }
示例#2
0
 public void CopyFile(string sourceFileSpec, string targetFileSpec)
 {
     if (SourceType == "L" && TargetType == "L")
     {
         SourceFiler.CopyFile(sourceFileSpec, targetFileSpec);
     }
     else if (SourceType == "L" && TargetType == "G")
     {
         PrepareTargetFile(targetFileSpec);
         TargetFiler.UploadFile(sourceFileSpec, targetFileSpec);
     }
     else if (SourceType == "G" && TargetType == "L")
     {
         PrepareTargetFile(targetFileSpec);
         SourceFiler.DownloadFile(sourceFileSpec, targetFileSpec);
     }
     else if (SourceType == "G" && TargetType == "G")
     {
         PrepareTargetFile(targetFileSpec);
         SourceFiler.CopyFile(sourceFileSpec, targetFileSpec);
     }
     else if (SourceType == "L" && TargetType == "A")
     {
         PrepareTargetFile(targetFileSpec);
         TargetFiler.UploadFile(sourceFileSpec, targetFileSpec);
     }
     else if (SourceType == "A" && TargetType == "L")
     {
         PrepareTargetFile(targetFileSpec);
         SourceFiler.DownloadFile(sourceFileSpec, targetFileSpec);
     }
     else if (SourceType == "A" && TargetType == "A")
     {
         PrepareTargetFile(targetFileSpec);
         SourceFiler.CopyFile(sourceFileSpec, targetFileSpec);
     }
     else if (SourceType == "G" && TargetType == "A")
     {
         //TODO: Won't work at the moment as A upload only works from L.
         PrepareTargetFile(targetFileSpec);
         TargetFiler.UploadFile(sourceFileSpec, targetFileSpec);
     }
     else if (SourceType == "A" && TargetType == "G")
     {
         //TODO: Won't work at the moment as A download only works from L.
         PrepareTargetFile(targetFileSpec);
         SourceFiler.DownloadFile(sourceFileSpec, targetFileSpec);
     }
 }