Example #1
0
  public File getFullExport(Consumer consumer, String cdnKey, String webAppPrefix, String apiUrl)
      throws ExportCreationException {
    // TODO: need to delete tmpDir (which contains the archive,
    // which we need to return...)
    try {
      File tmpDir = new SyncUtils(config).makeTempDir("export");
      File baseDir = new File(tmpDir.getAbsolutePath(), "export");
      baseDir.mkdir();

      exportMeta(baseDir, cdnKey);
      exportConsumer(baseDir, consumer, webAppPrefix, apiUrl);
      exportIdentityCertificate(baseDir, consumer);
      exportEntitlements(baseDir, consumer);
      exportEntitlementsCerts(baseDir, consumer, null, true);
      exportProducts(baseDir, consumer);
      exportConsumerTypes(baseDir);
      exportRules(baseDir);
      exportDistributorVersions(baseDir);
      exportContentDeliveryNetworks(baseDir);
      return makeArchive(consumer, tmpDir, baseDir);
    } catch (IOException e) {
      log.error("Error generating entitlement export", e);
      throw new ExportCreationException("Unable to create export archive", e);
    }
  }
Example #2
0
  public File getEntitlementExport(Consumer consumer, Set<Long> serials)
      throws ExportCreationException {
    // TODO: need to delete tmpDir (which contains the archive,
    // which we need to return...)
    try {
      File tmpDir = new SyncUtils(config).makeTempDir("export");
      File baseDir = new File(tmpDir.getAbsolutePath(), "export");
      baseDir.mkdir();

      exportMeta(baseDir, null);
      exportEntitlementsCerts(baseDir, consumer, serials, false);
      return makeArchive(consumer, tmpDir, baseDir);
    } catch (IOException e) {
      log.error("Error generating entitlement export", e);
      throw new ExportCreationException("Unable to create export archive", e);
    }
  }