Skip to content

DV-Uploader doesn't detect certain invalid filenames #12

@donsizemore

Description

@donsizemore

Don't know if this is worth an issue (if not, close it), but if a certain careless user makes two mistakes:

  1. Forget to provide the source filename
  2. Include an invalid argument, in this case -list-only

DV-Uploader dutifully attempts to upload the last argument, even though I'd expect a file- nor directory name would ever begin with a dash:

java.io.FileNotFoundException: -list-only (The system cannot find the file specified)
        at java.base/java.io.FileInputStream.open0(Native Method)
        at java.base/java.io.FileInputStream.open(FileInputStream.java:219)
        at java.base/java.io.FileInputStream.<init>(FileInputStream.java:157)
        at org.sead.uploader.util.FileResource.getInputStream(FileResource.java:125)
        at org.sead.uploader.dataverse.DVUploader.multipartDirectFileUpload(DVUploader.java:648)
        at org.sead.uploader.dataverse.DVUploader.uploadDatafile(DVUploader.java:409)
        at org.sead.uploader.AbstractUploader.uploadDatafile(AbstractUploader.java:454)
        at org.sead.uploader.AbstractUploader.processRequests(AbstractUploader.java:205)
        at org.sead.uploader.dataverse.DVUploader.main(DVUploader.java:120)
null

Again, feel free to give this the fabled "Moog" response.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions