[opencms-dev] how to find unused/not linked/orphan files in vfs - pls help

always.work.in.progress always.work.in.progress always.work.in.progress at gmail.com
Tue Feb 27 09:58:10 CET 2018


hi Stephan :)
i really thank you for your reply!
Can you show me a simple code example in order to better undestand that method
you have suggested to me ?
say that i have a "test" folder inside opencms VFS:

/test

and this folder contains some files (.pdf, .docx, etc)
how can i create the script in order to check the "orphaned" relations for
files inside "/test" folder ?

thanks in advance.

Il martedì 27 febbraio 2018, Stephan Schrader <zstephanz at gmail.com> ha
scritto:

> Hi,
>
> you can use: *CmsObject.getRelationsForResource(CmsResource resource,
> CmsRelationFilter filter)* with *CmsRelationFilter.SOURCE* as parameter.
> If the result is empty, no other resource references the given resource.
>
> Stephan
>
>
>
> 2018-02-23 17:59 GMT+01:00 always.work.in.progress always.work.in.progress
> <always.work.in.progress at gmail.com>:
>
>> hi all...
>> i am using Opencms 10.0.0/mysql set up in multisite environment (apache
>> + mod proxy)
>> i manage some large web sites plenty of xml contents/pages that link to
>> many internal uploaded pdf/images files/other filetypes etc..
>> often these files that are not needed anymore, are unlinked from related
>> xml contents, but unfortunately they are not deleted from the vfs workplace
>> and so become "forgotten".. :(
>>
>> Is there an internal workplace jsp script or function in order to find
>> these "orphan files" ?
>> i mean files that are present in vfs but not anymore linked from any xml
>> contents page;
>>
>> these files waste db blob space and the mysql database under opencms is
>> growing in size and getting more and more big..
>>
>> i tried to look for a way to do that but i've never found a similar
>> function/method..
>> it would be really useful in order to locate these unused  files and
>> delete them.
>>
>> thanks in advance for your reply.
>>
>> bye.
>>
>>
>>
>> _______________________________________________
>> This mail is sent to you from the opencms-dev mailing list
>> To change your list options, or to unsubscribe from the list, please visit
>> http://lists.opencms.org/cgi-bin/mailman/listinfo/opencms-dev
>>
>>
>>
>>
>>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://webmail.opencms.org/pipermail/opencms-dev/attachments/20180227/3778e748/attachment.htm>


More information about the opencms-dev mailing list