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

appNGizer Repository upload package should skip reload

    XMLWordPrintable

    Details

      Description

      uploading an application via appNGizer currently (re)loads the entire Reposity and ready the new Package from there. But this reload may take some time (see also APPNG-2296) or is not needed by the client.

      To confirm that the Package was uploaded successfully, it is sufficient to check the PackageArchive.

      current 1.20.1:

      org.appng.appngizer.controller.RepositoryController 267ff
      
      File outFile = new File(new File(r.getUri()), file.getOriginalFilename());
      FileUtils.writeByteArrayToFile(outFile, file.getBytes());
      PackageArchive packageArchive = RepositoryUtils.getPackage(r, outFile, file.getOriginalFilename());
      if (null != packageArchive) {
      	RepositoryCacheFactory.instance().getCache(r).reload();
      	PackageInfo packageInfo = packageArchive.getPackageInfo();
      	return getRepositoryPackage(name, packageInfo.getName(), packageInfo.getVersion(),
      			packageInfo.getTimestamp());
      } else {
      	FileUtils.deleteQuietly(outFile);
      	return reply(HttpStatus.BAD_REQUEST);
      }
      

      no reload:

      org.appng.appngizer.controller.RepositoryController 267ff
      
      File outFile = new File(new File(r.getUri()), file.getOriginalFilename());
      FileUtils.writeByteArrayToFile(outFile, file.getBytes());
      PackageArchive packageArchive = RepositoryUtils.getPackage(r, outFile, file.getOriginalFilename());
      if (null != packageArchive) {
      	Identifier installedApp = getApplicationByName(packageArchive.getPackageInfo().getName());
      	Identifier installedTemplate = templateService.getTemplateByName(packageArchive.getPackageInfo().getName());
      	Package pkg = getPackage(installedApp, installedTemplate, packageArchive.getPackageInfo());
      	return ok(pkg);
      } else {
      	FileUtils.deleteQuietly(outFile);
      	return reply(HttpStatus.BAD_REQUEST);
      }
      

        Attachments

          Issue Links

            Activity

              People

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

                Dates

                • Created:
                  Updated:
                  Resolved: