How can I find orphaned files in the Vault?

Hi, I want to track the amount of Files that are not related to a Document or Change Processes anymore. I noticed that these unrelated files are somehow assigned to the SystemFileContainer Orphaned Files Container. SystemFielContainer is used as PolySource in FileContainerItems. But I have some trouble to find the right query, to detect all of my orphaned Files. Does somebody have an example query for finding orphaned files? Or maybe just some hints, how these different ItemTypes stick together? Thanks and best regards! Angela
  • Hi Angela, You can use the sample code below to iterate through all of the Orphaned files. Chris
    Christopher Gillis Aras Labs Software Engineer
  • Hi Chris, Thanks for the fast answer and the code sample! I didn´t know about the FileContainerLocator. Finally I think I understand what the File_Handling.pdf provided in the Documentation folder want´s to tell me. Now let´s see if I get things right: 1. Regular files referred to ECOs, Documents, etc. -> no container assigned 2. Regular files removed from ECOs, Documents -> Orphaned Files Container -> can be automatically deleted when using the Force.Delete.Orphaned.Files Variable 3. Thumbnails, Files created by conversion server or any other files without container -> Global Files Container I wonder what´s the best way to clean up historic conversion server files? The files are easy to detect, as they all share a similar checkout path. But I do not think it´s good idea to remove them automatically. Do you have any recommendations? Right now the amount of Converser Server files is no problem, so this is more a question of "how to do things the correct way".
  • Hi Angela, You are correct about the behavior of Files and Containers expect for one thing. Files that are related to ECOs, Documents, etc. do have a container which corresponds to the ID of the relationship item. So a File related to a Document will have it's container set to the ID of the Document File relationship. In terms of recommendations for cleaning up older conversion server files, there's no "correct" way to do this. It's entirely dependent on your specific needs. If the amount of conversion server files is not a problem, you could not worry about cleaning them up at all. However, if it does eventually become a problem, one solution could be to periodically run a method that checks the age of the file using the created_on property and removes it if it is older than some amount. Chris
    Christopher Gillis Aras Labs Software Engineer
  • Hi Chris, thanks for the additional feedback, I very much like the idea to use a periodic method for the clean up based on the created_on property! Right now I am quite happy with our current file vault, it´s still quite tidy.