Search code examples
dspace

How to import zip file from batch importation in Windows?


i'm trying to import a zip file in windows by batch import dspace in prompt but the windows is not recognizing the DIR from file:

Apparently it is outputting twice the file path: How i can solve this?

C:\dspace5\bin>dspace import -a -e admin -c capes/218424 -s C:\Users\admins\Desktop\projects\community\migration\bitstreams -z SimpleArchiveFormat.zip -m mapfilesCOM

Using DSpace installation in: C:\dspace5
Destination collections:
Owning  Collection: materials
java.io.FileNotFoundException: C:\Users\admins\Desktop\projects\community\migration\bitstreams\C:\Users\admins\Desktop\projects\community\migration\bitstreams\SimpleArchiveFormat.zip (The syntax of the file name, directory name, or volume label is incorrect)
        at java.util.zip.ZipFile.open(Native Method)
        at java.util.zip.ZipFile.<init>(Unknown Source)
        at java.util.zip.ZipFile.<init>(Unknown Source)
        at java.util.zip.ZipFile.<init>(Unknown Source)
        at org.dspace.app.itemimport.ItemImport.unzip(ItemImport.java:2021)
        at org.dspace.app.itemimport.ItemImport.unzip(ItemImport.java:1987)
        at org.dspace.app.itemimport.ItemImport.unzip(ItemImport.java:2098)
        at org.dspace.app.itemimport.ItemImport.main(ItemImport.java:490)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
        at java.lang.reflect.Method.invoke(Unknown Source)
        at org.dspace.app.launcher.ScriptLauncher.runOneCommand(ScriptLauncher.java:226)
        at org.dspace.app.launcher.ScriptLauncher.main(ScriptLauncher.java:78)
java.io.FileNotFoundException: C:\Users\admins\Desktop\projects\community\migration\bitstreams\C:\Users\admins\Desktop\projects\community\migration\bitstreams\SimpleArchiveFormat.zip (The syntax of the file name, directory name, or volume label is incorrect)

Deleting temporary zip directory: /dspace5/imports
Started: 1512488260816
Ended: 1512488268886

Elapsed time: 8 secs (8070 msecs)

Solution

  • I believe your problem is this known (and fixed) bug in some versions of DSpace: https://jira.duraspace.org/browse/DS-3585

    You should either upgrade to a more recent version or reproduce the fix that is described in the issue and in DSpace's Git.

    Good luck !