Check existence of filedocument

0
For development purposes I want to use an acceptance database without all the files. The size and number of files are enormous. However, I am building functionality that creates a Zip of the filedocuments, and the java action crashes because the file isn't physically there. (Error: File does not exist for key:). All the java actions from community commons with a filedocument as input crash if the file does not exists.   Is there a way to check if the filedocument exists? For example, activate the database to reset the filedocument.hascontents. 
asked
1 answers
0

If this is only for local development you could consider updating the UUID column ( __uuid__) in the database to point to a small / empty file that you add on your local instance.

- create an empty file, name it eab71a45-12a3-d2b5-4a11-10aebf94b0de

- place it in the files deployment folder ea/b7/

- execute update query on system$filedocument and update __uuid__ column to eab71a45-12a3-d2b5-4a11-10aebf94b0de

(or something like that)

 

This way you will always have a file for each database record =)

the name in the example is ofcourse something you can create yourself, its an example...

 

answered