Advertisement
Guest User

Untitled

a guest
Jan 26th, 2016
65
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
F# 1.84 KB | None | 0 0
  1. type Server = {
  2.     ServerId : int;
  3.     ServerName : string;
  4.     ServerAddress : string;
  5.     UserName : string option;
  6.     Password : string option;
  7. }
  8.  
  9. type FileTransferDefinition = {
  10.     FileTransferDefinitionId : int;
  11.     FileTransferDefinitionName : string;
  12.     FileTransferTypeId : int;
  13.     FileTransferTypeName : string;
  14.     FileNameIncludeFilter : string;
  15.     FileNameExcludeFilter : string option;
  16.     SourceServerId : int;
  17.     SourceServerAddress : string;
  18.     RelativeSourcePath : string;
  19.     AbsoluteSourcePath : string;
  20.     TargetServerId : int;
  21.     TargetServerAddress : string;
  22.     RelativeTargetPath : string;
  23.     AbsoluteTargetPath : string;
  24. }
  25.  
  26. type FileTransferTypeData = {
  27.     FileTransferTypeId : int;
  28.     FileTransferTypeName : string;
  29. }
  30.  
  31. type FileTransferType =
  32.     | Move of FileTransferTypeData
  33.     | Copy of FileTransferTypeData
  34.  
  35. // move '*.(ts|mpg|mov|mxf)' from '$(source)/path/here' to '$(target)/path/here'
  36. // copy '*.(ts|mpg|mov|mxf)' from '$(source)/path/here' to '$(target)/path/here'
  37.  
  38. let updateSourcePath transfer path =
  39.     { transfer with
  40.         RelativeSourcePath = path;
  41.         AbsoluteSourcePath = transfer.SourceServerAddress + path }
  42.  
  43. let updateSourceServer transfer server =
  44.     { transfer with
  45.         SourceServerId = server.ServerId;
  46.         SourceServerAddress = server.ServerAddress;
  47.         AbsoluteSourcePath = server.ServerAddress + transfer.RelativeSourcePath
  48.     }
  49.  
  50. let updateTargetPath transfer path =
  51.     { transfer with
  52.         RelativeSourcePath = path;
  53.         AbsoluteSourcePath = transfer.TargetServerAddress + path }
  54.        
  55. let updateTargetServer transfer server =
  56.     { transfer with
  57.         TargetServerId = server.ServerId;
  58.         TargetServerAddress = server.ServerAddress;
  59.         AbsoluteTargetPath = server.ServerAddress + transfer.RelativeTargetPath
  60.     }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement