Check if mount point already exists

Typically, we create the mount point directory when we mount the
filesystem, and then we remove the directory when we unmount. Currently,
we aren't accounting for the case where the directory already exists,
e.g. if the BMC reboots while the filesystem is mounted.

This commit adds a check to see if the directory is already present. If
so, it won't try to create the directory again.

Tested:
1. Formatted an eMMC using the FormatLuks method, which also creates the
   mount point and mounts the filesystem.
2. Rebooted the BMC
3. Ran the Unlock method to unlock the LUKS device and mount the
   filesystem.

Signed-off-by: John Wedig <johnwedig@google.com>
Change-Id: I3e279c653b21f570b97e4d530a19e5ae30bf8719
diff --git a/include/filesystemInterface.hpp b/include/filesystemInterface.hpp
index d34ff06..0f276a7 100644
--- a/include/filesystemInterface.hpp
+++ b/include/filesystemInterface.hpp
@@ -70,6 +70,14 @@
      *  @returns true on success, false otherwise.
      */
     virtual bool removeDirectory(const std::filesystem::path& p) = 0;
+
+    /** @brief Wrapper around std::filesystem::is_directory
+     *
+     *  @param[in] p - path to directory that we want to query.
+     *
+     *  @returns true if the path exists and represents a directory.
+     */
+    virtual bool directoryExists(const std::filesystem::path& p) = 0;
 };
 
 /** @class Filesystem
@@ -107,5 +115,10 @@
     {
         return std::filesystem::remove(p);
     }
+
+    bool directoryExists(const std::filesystem::path& p) override
+    {
+        return std::filesystem::is_directory(std::filesystem::status(p));
+    }
 };
 } // namespace estoraged