<remark>Updated directory structure from flat to hierarchical.</remark>
</revision>
<revision>
<version>0.2</version>
<date>2003-07-23</date>
<initials>rwe</initials>
<remark>Fixed bad data types in the schema.</remark>
</revision>
<revision>
<version>0.1</version>
<date>2003-07-09</date>
<initials>rwe</initials>
<remark>Initial version.</remark>
</revision>
</header>
<section1topic='Introduction'>
<p>File transfers of entire trees require a lot more meta-data 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 meta-data so that directory trees can be transfered.</p>
</section1>
<section1topic='Requirements'>
<ul>
<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>