Uploaded image for project: 'Bitrepository'
  1. Bitrepository
  2. BITMAG-977

Command line client scripts break on arguments containing whitespaces

    XMLWordPrintable

Details

    • Bug
    • Resolution: Won't Fix
    • Minor
    • None
    • 1.0
    • Commandline client
    • None

    Description

      When trying e.g. to put a file with spaces, an IllegalArgumentException is thrown (see exception below).

      This appears to be due to incorrect quoting in the shell scripts (putfile.sh etc). Instead of $*, use "$@" (including quotes!), to make sure all arguments are quoted correctly and passed on intact to the java process.

      $ ./putfile.sh -c books -f ~/Downloads/This\ is\ Gallifrey.pdf -i Gallifrey
      Initialising arguments...
      Creating client.
      Putting .
      java.lang.IllegalArgumentException: The file '/home/asser/Downloads/This' is invalid. It does not exists or it is a directory.
      at org.bitrepository.commandline.CommandLineClient.findTheFile(CommandLineClient.java:276)
      at org.bitrepository.commandline.PutFile.putTheFile(PutFile.java:120)
      at org.bitrepository.commandline.PutFile.performOperation(PutFile.java:79)
      at org.bitrepository.commandline.CommandLineClient.runCommand(CommandLineClient.java:63)
      at org.bitrepository.commandline.PutFile.main(PutFile.java:52)

      Attachments

        Activity

          People

            Unassigned Unassigned
            assf@kb.dk Asser Schrøder Femø (Inactive)
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: