How to share a directory with a share link

Is there anybody who has some codes to allow pimcore to share an asset with others using a share link?
Please share your codes here for me and those ones that need such a great feature.

Thanks in advance