XML data struct - rsanchez-wsu/jfiles GitHub Wiki
Q. Do we want to send an entire recursively-generated directory structure in the XML?
A. No, our team's approach to sending the file system structure between the server and the client will be layered approach. We will send the top-level structure to the client, and then if the client chooses to select a sub-directory, we will at that time send another XML file with the structure of the sub directory in it.
<fileSystem>
<currentPath>
<system>DOS</system>
<path>C:\Users\dummy\Documents</path>
</currentPath>
<directory>
<name>Documents</name>
<lastModifiedTime>10/03/16 02:35:15</lastModifiedTime>
<lastAccessTime>10/03/16 02:35:15</lastAccessTime>
<creationTime>10/02/16 02:35:15</creationTime>
<size>115</size>
</directory>
<file>
<name>compressed_folder.zip</name>
<size unit="bytes">40476900</size>
<blocks>9883</blocks>
<type mime-type="application/zip">zip<type>
<create>2016-09-16T05:35:11</create>
<modified>2016-09-16T05:35T11</modified>
<owner>user</owner>
<owner_group>administrator</owner_group>
<permissions type="Unix">777</permissions>
</file>
<link>
<name>link</name>
<create>2016-04-26T06:54:12</create>
<modified>2016-04-26T06:54:12</modified>
<owner>user</owner>
<owner_group>administrator</owner_group>
<permissions type="Unix">777</permissions>
<target>/foo/bar/target.txt</target>
</link>
</fileSystem>
Also, a read request could be made on an individual file, folder, or link. This should result in the same XML structure being sent, but only containing a single item.
Another type was mentioned, special. Not sure how these should be treated. We may just want to ignore them.
What kind of metadata should be included? This depends on what kind of system (Linux vs. Windows) the host is.
- Size (type=bits,bytes...)
- Type (mime-type, ???)
- Created datetime
- Last Modified datetime
- Blocks?
- Permissions (type=Linux,Windows)
- Owner name
- Owner groups
- Number of links
- Attributes (read-only, archieve, hidden, etc.)