src/main/java/saps/common/core/storage/swift/SwiftPermanentStorage.java
/**
   * This function tries to archive a task folder in Swift.
   *
   * @param taskId task id in archive process
   * @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 to archive a task folder in Swift.
@param taskId task id in archive process
@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 to archive a task folder in Swift . @param taskId task id in archive process @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 archive(String taskId, String localDir, String swiftDir) {
    LOGGER.info(
        "Trying to archive task ["
            + taskId
            + "] "
            + localDir
            + " folder to "
            + swiftDir
            + " folder with a maximum of "
            + MAX_ARCHIVE_TRIES
            + " archiving attempts");
    File localFileDir = new File(localDir);
    if (!localFileDir.exists() || !localFileDir.isDirectory()) {
      LOGGER.error(
          "Failed to archive task ["
              + taskId
              + "]. "
              + localDir
              + " folder isn't directory or not exists");
      return false;
    }
    for (int itry = 0; itry < MAX_ARCHIVE_TRIES; itry++) {
      LOGGER.info("Trying to archive task [" + taskId + "] " + localDir + " folder for swift");
      if (uploadFiles(localFileDir, swiftDir)) return true;
    }
    return false;
  }
private boolean archive ( String taskId , String localDir , String swiftDir ) { LOGGER . info ( "Trying to archive task [" + taskId + "] " + localDir + " folder to " + swiftDir + " folder with a maximum of " + MAX_ARCHIVE_TRIES + " archiving attempts" ) ; File localFileDir = new File ( localDir ) ; if ( ! localFileDir . exists ( ) || ! localFileDir . isDirectory ( ) ) { LOGGER . error ( "Failed to archive task [" + taskId + "]. " + localDir + " folder isn't directory or not exists" ) ; return false ; } for ( int itry = 0 ; itry < MAX_ARCHIVE_TRIES ; itry ++ ) { LOGGER . info ( "Trying to archive task [" + taskId + "] " + localDir + " folder for swift" ) ; if ( uploadFiles ( localFileDir , swiftDir ) ) return true ; } return false ; }
This function tries to archive a task folder in Swift.
This function tries to archive a task folder in Swift .