Skip to content

Commit

Permalink
Examples update
Browse files Browse the repository at this point in the history
  • Loading branch information
HardNorth committed Feb 12, 2024
1 parent 25002f6 commit f4b496b
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,9 @@
import java.io.InputStream;
import java.io.OutputStream;

/**
* Utility file to copy / read resource files.
*/
public class AttachmentHelper {
public static final String FILE_NAME = "file";

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,11 @@
import org.slf4j.LoggerFactory;

import java.io.File;
import java.util.Base64;

/**
* Useful for binary data (e.g. sending files to ReportPortal)
*
* @author Andrei Varabyeu
* Useful utility class for binary data logging (e.g. sending files to ReportPortal). You can disable console output for
* `binary_data_logger` to avoid redundant verbose output.
*/
public class LoggingUtils {

Expand All @@ -21,4 +21,12 @@ private LoggingUtils() {
public static void log(File file, String message) {
LOGGER.info("RP_MESSAGE#FILE#{}#{}", file.getAbsolutePath(), message);
}

public static void logBase64(String base64, String message) {
LOGGER.info("RP_MESSAGE#BASE64#{}#{}", base64, message);
}

public static void log(byte[] bytes, String message) {
logBase64(Base64.getEncoder().encodeToString(bytes), message);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ public static int luckyInt(int bound) {
}

/**
* Just put probability and check your luckyness
* Just put probability and check your luckiness
*
* @param probability value [0--100]
* @return TRUE if you are really lucky!
Expand Down

0 comments on commit f4b496b

Please sign in to comment.