Uploaded image for project: 'ShrinkWrap'
  1. ShrinkWrap
  2. SHRINKWRAP-459

Misleading exception message when creating an Archive from a Zip file

    XMLWordPrintable

Details

    • Bug
    • Resolution: Duplicate
    • Major
    • None
    • 1.1.2
    • None
    • None

    Description

      When I try to create an Archive from a zip file using

      ShrinkWrap.createFromZipFile(WebArchive.class, new File("not-existent-file.zip"));

      I get:

      IllegalArgumentException: File for import exist: not-existent-file.zip

      I took a look at the source code and found that the
      org.jboss.shrinkwrap.api.ArchiveFactory.createFromZipFile(Class<T>, File)

      contains the statement

      if (!(archiveFile.exists())) {
      throw new IllegalArgumentException("File for import exist: "
      + archiveFile.getAbsolutePath());
      }

      I guess the exception message should be: File for import does not exist:

      Attachments

        Issue Links

          Activity

            People

              mmatloka Michal Matloka (Inactive)
              rene.link René Link (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: