0 Replies Latest reply on Dec 1, 2017 11:10 AM by Shane Kelly

    Determining if binary already exists using SHA-1 hash

    Shane Kelly Newbie

      Folks,

       

      I'm aware that ModeShape stores files in the binary store using their SHA-1 hash to avoid duplication - I was wondering if there is an efficient way to search a JCR repository by HexHash rather than JCR UUID or path. The use case is that I want to check before uploading a 'new' file to our JCR repository that it doesn't already exist in the repository - one way might be to incorporate the hexhash into the JCR path where the file is notionally stored, and search for the existence of a node at that path - only uploading if a node doesn't exist at that path. But I was hoping to avoid that so that we could use whatever JCR path naming we desire in our persistence store whilst being able to search by HexHash - is that possible? Or is there a better/more sensible approach?

       

      Regards,

       

      Shane