Source:
<code>public Response registerDataFileAll() { Integer count = fileService.findAll().size(); Integer successes = 0; Integer alreadyRegistered = 0; logger.info("Starting to register " + count + " files. " + new Date()); for (DataFile df : fileService.findAll()) { try { if ((df.getIdentifier() == null || df.getIdentifier().isEmpty())&& df.isReleased()) { <START> User u =findAuthenticatedUserOrDie(); <END> DataverseRequest r = createDataverseRequest(u); execCommand(new RegisterDvObjectCommand(r, df)); successes++; if (successes % 100 == 0){ logger.info(successes + " of " + count + " files registered successfully. " + new Date()); } } else { alreadyRegistered++; } } catch (WrappedResponse ex) { logger.info("Failed to register file id: "+df.getId()); Logger.getLogger(Datasets.class.getName()).log(Level.SEVERE, null, ex); } catch (Exception e){ logger.info("Unexpected Exception: " + e.getMessage()); } } logger.info(alreadyRegistered + " of " + count + " files were already registered. " + new Date()); logger.info(successes + " of " + count + " files registered successfully. " + new Date()); return ok("Datafile registration complete." + successes + " of " + count + " files registered successfully."); }</code><technical_language>I spoke @sekmiller adding check for isReleased agree more consistent new datasets created published. sort of wondering a change findUserOrDie. Also, changes registerDataFile method well</technical_language>

Target:
public Response registerDataFileAll() { Integer count = fileService.findAll().size(); Integer successes = 0; Integer alreadyRegistered = 0; Integer released = 0; Integer draft = 0; logger.info("Starting to register: analyzing " + count + " files. " + new Date()); logger.info("Only unregistered, published files will be registered."); for (DataFile df : fileService.findAll()) { try { if ((df.getIdentifier() == null || df.getIdentifier().isEmpty())) { if (df.isReleased()) { released++; User u = findAuthenticatedUserOrDie(); DataverseRequest r = createDataverseRequest(u); execCommand(new RegisterDvObjectCommand(r, df)); successes++; if (successes % 100 == 0) { logger.info(successes + " of " + count + " files registered successfully. " + new Date()); } } else { draft++; logger.info(draft + " of " + count + " files not yet published"); } } else { alreadyRegistered++; logger.info(alreadyRegistered + " of " + count + " files are already registered. " + new Date()); } } catch (WrappedResponse ex) { released++; logger.info("Failed to register file id: " + df.getId()); Logger.getLogger(Datasets.class.getName()).log(Level.SEVERE, null, ex); } catch (Exception e) { logger.info("Unexpected Exception: " + e.getMessage()); } } logger.info("Final Results:"); logger.info(alreadyRegistered + " of " + count + " files were already registered. " + new Date()); logger.info(draft + " of " + count + " files are not yet published. " + new Date()); logger.info(released + " of " + count + " unregistered, published files to register. " + new Date()); logger.info(successes + " of " + released + " unregistered, published files registered successfully. " + new Date()); return ok("Datafile registration complete." + successes + " of " + released + " unregistered, published files registered successfully."); }