[opencms-dev] Access a file by uuid

Yves Glodt yg at mind.lu
Mon Dec 8 17:12:20 CET 2008


On Monday 08 December 2008 16:56:02 Yves Glodt wrote:
> Hello,
>
> is it possible to find and access a file in the VFS by it's uuid?

Sorry for selfreplying but I found a way to do it in the meantime:

CmsObject cms = OpenCms.initCmsObject("FileReader");
cms.loginUser("user", "pass");
CmsResource res = cms.readResource(new CmsUUID("dd8e049e-c2d4-11dd-
a9f2-0015174f605e"));

But unfortunately it produces an error:
"Error reading resource with the ID dd8e049e-c2d4-11dd-a9f2-0015174f605e."

Any idea why?

Best regards,
Yves

> Background: I have certains PDF documents in my vfs which are not
> accessible for any user, logged in or not, and I want to serve them with
> obfuscated urls à la /getFile.jsp?id=xxxxxx and it would be nice if I could
> just use the uuid to identify them.
> I use OpenCms 7.0.4. Maybe there is another way to achieve this...? :-)
>
> Best regards,
> Yves


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://webmail.opencms.org/pipermail/opencms-dev/attachments/20081208/80b1df3b/attachment.htm>


More information about the opencms-dev mailing list