我尝试通过 dspace 打包程序导出一个集合,但这导致了一个 Java 异常:
异常:java.io.FileNotFoundException:/home/dspace/dspace/assetstore/24/53/70/24537062703407880406826961992454636643(没有此文件或目录)
我想找到(并可能清除)资产商店中项目和缺失文件之间的所有这些引用。有人能给我一些建议吗?谢谢。
答案1
最终,我成功解决了这个问题。也许它甚至可能更好,但我的解决方法如下:我们使用以下查询将所有比特流的路径导出到文本文件 (internal_id.txt):
从比特流 b 中选择子字符串(b.internal_id 为 2)|| '/' || 子字符串(b.internal_id 来自 3 为 2)|| '/' || 子字符串(b.internal_id 来自 5 为 2)|| '/' || b.internal_id 作为 bitstream_path
之后,我用这个小脚本检查了资产商店中这些位流的存在:
#!/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
为了获取有关缺少比特流的记录的详细信息,我使用了以下查询
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
我希望这可以帮助别人......