src/main/java/saps/common/core/storage/swift/SwiftPermanentStorage.java
/**
   * This function tries upload task folder files to Swift.
   *
   * @param localDir task folder to be archived
   * @param swiftDir directory swift to archive new data
   * @return boolean representation, success (true) or failure (false) to archive
   */
This function tries upload task folder files to Swift.
@param localDir task folder to be archived
@param swiftDir directory swift to archive new data
@return boolean representation, success (true) or failure (false) to archive
This function tries upload task folder files to Swift . @param localDir task folder to be archived @param swiftDir directory swift to archive new data @return boolean representation success ( true ) or failure ( false ) to archive
private boolean uploadFiles(File localDir, String swiftDir) {
    try {
      for (File actualFile : localDir.listFiles()) {
        if (!uploadFile(actualFile, swiftDir)) {
          LOGGER.info("Failure in archiving file [" + actualFile.getAbsolutePath() + "]");
          return false;
        }
      }
    } catch (NullPointerException np) {
      LOGGER.error("Error while uploading files", np);
      return false;
    }
    LOGGER.info("Upload to swift successfully done");
    return true;
  }
private boolean uploadFiles ( File localDir , String swiftDir ) { try { for ( File actualFile : localDir . listFiles ( ) ) { if ( ! uploadFile ( actualFile , swiftDir ) ) { LOGGER . info ( "Failure in archiving file [" + actualFile . getAbsolutePath ( ) + "]" ) ; return false ; } } } catch ( NullPointerException np ) { LOGGER . error ( "Error while uploading files" , np ) ; return false ; } LOGGER . info ( "Upload to swift successfully done" ) ; return true ; }
This function tries upload task folder files to Swift.
This function tries upload task folder files to Swift .
// TODO What should really be done when one or more files fail to upload?