Currently the id attributes of Files in XML import are being ignored (i.e. the id attribution is left to domain entities).
Should this be fixed? Please note, that a "fix" would imply some additional consistency checking when importing from XML. For example, assume that the largest id in xml is 100. Next, a plain is imported, with a non-existent path: /did/not/exit/plain.txt and that plain has an id of 11. We cannot give /did an id of 11, so for those cases we would need to have some sort of "reverse counter" (for example it starts at Integer.MAX_VALUE and gets decremented with every previously unspecified directory created).
I think you should sort the Files by ID when importing. That way, you make sure that parent's and such are consistent.
If XML files can be imported more than once (not just on FileSystem initialization), you could sort file Files by ID and then ignore the ID when creating the File
If you don't want to keep the FileSystem exactly has it was when exported (e.g. with the same ID), then you could ignore the ID and sort the files by path when importing instead.
Currently the id attributes of
File
s in XML import are being ignored (i.e. the id attribution is left to domain entities).Should this be fixed? Please note, that a "fix" would imply some additional consistency checking when importing from XML. For example, assume that the largest
id
in xml is100
. Next, aplain
is imported, with a non-existent path:/did/not/exit/plain.txt
and thatplain
has anid
of11
. We cannot give/did
anid
of11
, so for those cases we would need to have some sort of "reverse counter" (for example it starts atInteger.MAX_VALUE
and gets decremented with every previously unspecified directory created).