Uploaded image for project: 'appNG'
  1. appNG
  2. APPNG-2162

Checksum check fails on empty files for non-filebased applications

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Done
    • Priority: Medium
    • Resolution: Done
    • Affects Version/s: None
    • Fix Version/s: 1.17.1
    • Component/s: None
    • Labels:
      None

      Description

      If you use an empty Resourcefile (e.g. mymessages.properties) in a non-filebased application, the checksum check fails.

      org.appng.api.support.ApplicationResourceHolder
      public void dumpToCache(ResourceType... types) {
      ...
      	String proposedChecksum = DigestUtils.sha256Hex(resource.getBytes());
      	if (!proposedChecksum.equals(resource.getCheckSum())) {
      		throw new IOException(
      		String.format("the checksum for applicationresource#%s (%s) did not match!", resource.getId(), resource.getName()));
      	}
      ...
      }

      the proposedChecksum is always calculated but it is not calculated in the database for empty files:

      org.appng.core.domain.ResourceImpl
      public void calculateChecksum() {
      	if (getSize() > 0) {
      		setCheckSum(DigestUtils.sha256Hex(getBytes()));
      	}
      }
      

        Attachments

          Activity

            People

            • Assignee:
              mueller.matthias Matthias Müller
              Reporter:
              c.brueckner Christian Brückner
            • Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: