0

I tried to export a collection through the dspace packager but that leads me to a java exception:

Exception: java.io.FileNotFoundException: /home/dspace/dspace/assetstore/24/53/70/24537062703407880406826961992454636643 (There is no such file or directory)

I want to find (and possibly to clean) all these references between items and missing files in the assetstore. Can someone please give me some advice. Thank you.

Livpet
  • 1
  • 2

1 Answers1

0

After all, I managed to solve the problem. Probably it may be even better, but here's how I solved it: we exported to a text file (internal_id.txt) the paths of all bitstreams using the following query:

select substring(b.internal_id for 2) || '/' || substring(b.internal_id from 3 for 2) || '/' || substring(b.internal_id from 5 for 2) || '/' || b.internal_id as bitstream_path from bitstream b

After that I checked the existence of those bistreams in the assetstore with this little script:

#!/bin/sh

homedspace=/home/dspace
assetd=$homedspace/assetstore

for i in `cat $homedspace/internal_id.txt`;
do
  bitstr="$assetd/$i"
  if [ ! -f $fbitstr ]; then
    echo "$i"
  fi;
done

To get details about the records that have missing bitstreams I used the following query

select
    ob.uuid
    ,h.handle
    ,i.item_id
    ,bfr.short_description
    ,mv.text_value
    ,substring(b.internal_id for 2) || '/' || substring(b.internal_id from 3 for 2) || '/' || substring(b.internal_id from 5 for 2) || '/' || b.internal_id as bitstream_path
from
    dspaceobject ob
left join handle h on
    ob.uuid = h.resource_id 
left join item i on
    i.uuid = ob.uuid
left join bitstream b on
    b.uuid = ob.uuid
left join bitstreamformatregistry bfr on
    bfr.bitstream_format_id = b.bitstream_format_id
join metadatavalue mv on
    mv.dspace_object_id = ob.uuid
    and b.internal_id in 
    ('114010604776142507469236848335815822008',
    '144380007015254523440612284014079661640',
    '72819755632666247567002874213191474609')
    order by b.internal_id

I hope this can helps somebody...

Livpet
  • 1
  • 2