fcrepo-exts / fcrepo-import-export

Apache License 2.0
15 stars 19 forks source link

Import bags when the directory is prefixed with '.' #147

Closed mikejritter closed 4 years ago

mikejritter commented 4 years ago

Resolves: https://jira.lyrasis.org/browse/FCREPO-3386


Testing

  1. Start a fresh fedora repository, e.g. with fcrepo4-docker FEDORA_TAG=5.1.0 docker-compose up -d
  2. Create a binary in the repository
  3. Create a bag-config.yml for export
    bag-info.txt:
     Source-Organization: fcrepo-import-export
     Organization-Address: localhost
     External-Description: BagIt Bag
  4. Run the exporter
    java -jar target/fcrepo-import-export-0.4.0-SNAPSHOT.jar --mode export --resource http://localhost:8080/fcrepo/rest --dir fcrepo-3386  --binaries --bag-profile beyondtherepository --bag-config bag-config.yml --user fedoraAdmin:secret3
  5. Run the import prefixing the directory with ./
    java -jar target/fcrepo-import-export-0.4.0-SNAPSHOT.jar --mode import --resource http://localhost:8080/fcrepo/rest --dir ./fcrepo-3386  --binaries --bag-profile beyondtherepository --bag-config bag-config.yml --user fedoraAdmin:secret3

    a. I also tested against ./fcrepo-3386.tar, ../fcrepo-3386.tar, and ../fcrepo-3386. The Fedora repository was reset between each run to ensure the binaries were correctly uploaded by bringing down the docker container and starting a fresh version again.