[opencms-dev] Access a file by uuid

Sandrine Prousteau s.prousteau at eurelis.com
Thu Dec 11 18:14:52 CET 2008


Hi

I'd like to do the same thing, I have the same result...

I work on OpenCms 7.0.5.

 

________________________________

De : opencms-dev-bounces at opencms.org [mailto:opencms-dev-bounces at opencms.org] De la part de Yves Glodt
Envoyé : lundi 8 décembre 2008 17:12
À : The OpenCms mailing list
Objet : Re: [opencms-dev] Access a file by uuid

 

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/20081211/66e58f00/attachment.htm>


More information about the opencms-dev mailing list