<p>File transfers of entire trees require a lot more metadata and prior setup to link paths to files with unique ids so that clients can track them. This profile provides a more robust method of defining that metadata so that directory trees can be transfered.</p>
<li>Provide a full featured set of information that is applicable to tree transfers.</li>
<li>Meta-data that is to be provided:
<ul>
<li>number of files</li>
<li>size of entire tree</li>
<li>list of files and stream ids</li>
</ul>
</li>
</ul>
</section1>
<section1topic='Usage'>
<p>The tree transfer profile is in the "http://jabber.org/protocol/si/profile/tree-transfer" namespace. The profile is fairly simple: it consists of the root element with child elements that specify a directory structure of files with stream ids that will be used for each file.</p>
<p>This profile requires support for the File Transfer profile described in &xep0096;. Once you have accepted this SI, a new SI using the File Transfer profile will be offered for each file in the tree. This profile provides a mapping of files with paths and reserved stream ids which will be used to auto-accept a File Transfer SI that uses that same stream id from the sender.</p>
<p>The only possible child element of the root is <directory/> since there are other specifications that handle single file transfers. The directory structure is sent in a hierarchical manner with nested <directory/> and/or <file/> tags. One or more <file/> elements will be sent, one for each file. One or more <directory/> elements will be sent, one for each directory.</p>
<p>The <directory/> element has one attribute:</p>
<ul>
<li><em>name</em> - The name of the directory to create on the target system.</li>
</ul>
<p>The attribute is REQUIRED on each <directory/> element.</p>
<p>The <file/> element has two attributes:</p>
<ul>
<li><em>sid</em> - The stream id that MUST be sent for the File Transfer SI.</li>
<li><em>name</em> - The name of the file. The file should be saved to the same location in the target directory tree as the <directory/> hierarchy defines.</li>
</ul>
<p>Both attributes are REQUIRED on each <file/> element. The total number of <file> elements MUST equal the numfiles attribute sent in the <tree/> element.</p>
<p>The stream-method that is accepted for a Tree Profile SI MUST be remembered and the subsequent File Transfer SIs MUST NOT provide a Feature Negotiation packet. The stream-method has already been chosen and should be used for all of the streams.</p>