/// <summary>
        /// Constructor
        /// </summary>
        /// <param name="partType">The type of part (Attachment, Jdf or Jmf).</param>
        /// <param name="destinationFolder">The folder where the item will be placed.  If relative, this
        /// folder is relative to the uriBase of the owning FileTransmitterEncoderConfigurationItem.  It
        /// may also be absolute.</param>
        /// <param name="referenceFolder">The folder that will be used in URI references to the item.
        /// If relative, this
        /// folder is relative to the uriBase of the owning FileTransmitterEncoderConfigurationItem.  It
        /// may also be absolute.</param>
        /// <param name="order">Items are placed in order from 0 to n.  If order provided is less than zero, attachments will get
        /// order = 0, JDF will get order = 1 and JMF will get order = 2.</param>
        /// <param name="nameValues">Additional configuration as name/values.</param>
        /// <param name="suppress">True if output of the given item should be suppressed.
        /// JMF parts can be suppressed by simply an item of the type.  Because
        /// JDF items and Attachment items are included by default, you must configure a JDF FolderInfo with
        /// suppress=true to suppress JDF or attachments.</param>
        /// <remarks>
        /// <para>
        /// Both destinationFolder and referenceFolder support the following special values as all or part of the path:
        /// </para>
        /// <para>
        /// {Root} indicates that the path refers to the root of the folder indicated by the FileTransmitterEncoderConfigurationItem's
        /// baseUri property.
        /// </para>
        /// <para>
        /// {Guid" is a unique GUID string generated by the system for each transmission.
        /// </para>
        /// <para>
        /// {Attributes.[attrName]} is an attribute from the root node of the JDF part.  If there is no JDF part,
        /// this will be an empty string.
        /// </para>
        /// </remarks>
        public FileTransmitterFolderInfo(FolderInfoTypeEnum partType, string destinationFolder, string referenceFolder, int order,
                                         bool suppress, IDictionary <string, string> nameValues)
        {
            ParameterCheck.ParameterRequired(partType, "partType");

            if (destinationFolder == null)
            {
                destinationFolder = "${Root}";
            }
            if (referenceFolder == null)
            {
                referenceFolder = "${Root}";
            }

            this.suppress          = suppress;
            this.destinationFolder = destinationFolder.EnsureTrailingSlash();
            this.referenceFolder   = referenceFolder.EnsureTrailingSlash();
            this.order             = order;

            this.nameValues = new ReadOnlyDictionary <string, string>(nameValues ?? new Dictionary <string, string>());

            switch (partType)
            {
            case FolderInfoTypeEnum.Attachment:
            case FolderInfoTypeEnum.Jdf:
            case FolderInfoTypeEnum.Jmf:
                folderInfoType = partType;
                break;

            default:
                throw new JdfException(string.Format(Messages.PartTypeMustBeAttachmentJdfOrJmfTheTypeGivenForFolderInfo, partType));
            }

            if (order < 0)
            {
                this.order = (int)folderInfoType;
            }
        }
 /// <summary>
 /// Constructor
 /// </summary>
 /// <param name="partType">The type of part (Attachment, Jdf or Jmf).</param>
 /// <param name="destinationFolder">The folder where the item will be placed.  If relative, this
 /// folder is relative to the uriBase of the owning FileTransmitterEncoderConfigurationItem.  It
 /// may also be absolute.</param>
 /// <param name="referenceFolder">The folder that will be used in URI references to the item.
 /// If relative, this
 /// folder is relative to the uriBase of the owning FileTransmitterEncoderConfigurationItem.  It
 /// may also be absolute.</param>
 /// <param name="order">Items are placed in order from 0 to n.  If order provided is less than zero, attachments will get
 /// order = 0, JDF will get order = 1 and JMF will get order = 2.</param>
 /// <param name="nameValues">Additional configuration as name/values.</param>
 /// <remarks>
 /// <para>
 /// Both destinationFolder and referenceFolder support the following special values as all or part of the path:
 /// </para>
 /// <para>
 /// {Root} indicates that the path refers to the root of the folder indicated by the FileTransmitterEncoderConfigurationItem's
 /// baseUri property.
 /// </para>
 /// <para>
 /// {Guid" is a unique GUID string generated by the system for each transmission.
 /// </para>
 /// <para>
 /// {Attributes.[attrName]} is an attribute from the root node of the JDF part.  If there is no JDF part,
 /// this will be an empty string.
 /// </para>
 /// </remarks>
 public FileTransmitterFolderInfo(FolderInfoTypeEnum partType, string destinationFolder, string referenceFolder,
                                  int order = 0, IDictionary <string, string> nameValues = null) :
     this(partType, destinationFolder, referenceFolder, order, false, nameValues)
 {
 }
 /// <summary>
 /// Construct a default FolderInfo for the given part type.
 /// </summary>
 /// <param name="partType">The type of part (Attachment, Jdf or Jmf).</param>
 public FileTransmitterFolderInfo(FolderInfoTypeEnum partType) :
     this(partType, null, null, -1, null)
 {
 }
 /// <summary>
 /// Add Folder Info
 /// </summary>
 /// <param name="type">The <see cref="FolderInfoTypeEnum"/> type</param>
 /// <param name="destinationFolder">The destination folder</param>
 /// <param name="referenceFolder">The reference folder</param>
 /// <param name="order">The optional order to write the files.</param>
 /// <param name="nameValues">Additional Parameters</param>
 /// <returns></returns>
 public FileTransmitterEncoderBuilder FolderInfo(FolderInfoTypeEnum type, Uri destinationFolder,
                                                 Uri referenceFolder = null, int order = 0, IDictionary <string, string> nameValues = null)
 {
     return(this.FolderInfo(type, destinationFolder.ToString(), false, referenceFolder != null ? referenceFolder.ToString() : null, order, nameValues));
 }
 /// <summary>
 /// Add Folder Info
 /// </summary>
 /// <param name="type">The <see cref="FolderInfoTypeEnum"/> type</param>
 /// <param name="destinationFolder">The destination folder</param>
 /// <param name="referenceFolder">The reference folder</param>
 /// <param name="order">The optional order to write the files.</param>
 /// <param name="suppress">Suppress the output</param>
 /// <param name="nameValues">Additional Parameters</param>
 /// <returns></returns>
 public FileTransmitterEncoderBuilder FolderInfo(FolderInfoTypeEnum type, string destinationFolder, bool suppress,
                                                 string referenceFolder = null, int order = 0, IDictionary <string, string> nameValues = null)
 {
     encoder.AddFolderInfo(new FileTransmitterFolderInfo(type, destinationFolder, referenceFolder ?? destinationFolder, order, suppress, nameValues));
     return(this);
 }
 /// <summary>
 /// Add Folder Info
 /// </summary>
 /// <param name="type">The <see cref="FolderInfoTypeEnum"/> type</param>
 /// <param name="destinationFolder">The destination folder</param>
 /// <param name="referenceFolder">The reference folder</param>
 /// <param name="order">The optional order to write the files.</param>
 /// <param name="suppress">Suppress the output</param>
 /// <param name="nameValues">Additional Parameters</param>
 /// <returns></returns>
 public FileTransmitterEncoderBuilder FolderInfo(FolderInfoTypeEnum type, string destinationFolder,  bool suppress,
                                                 string referenceFolder = null, int order = 0, IDictionary<string, string> nameValues = null) {
     encoder.AddFolderInfo(new FileTransmitterFolderInfo(type, destinationFolder, referenceFolder ?? destinationFolder, order, suppress, nameValues));
     return this;
 }
 /// <summary>
 /// Add Folder Info
 /// </summary>
 /// <param name="type">The <see cref="FolderInfoTypeEnum"/> type</param>
 /// <param name="destinationFolder">The destination folder</param>
 /// <param name="referenceFolder">The reference folder</param>
 /// <param name="order">The optional order to write the files.</param>
 /// <param name="nameValues">Additional Parameters</param>
 /// <returns></returns>
 public FileTransmitterEncoderBuilder FolderInfo(FolderInfoTypeEnum type, Uri destinationFolder,
                                                 Uri referenceFolder = null, int order = 0, IDictionary<string, string> nameValues = null) {
     return this.FolderInfo(type, destinationFolder.ToString(), false, referenceFolder != null ? referenceFolder.ToString() : null, order, nameValues);
 }