![JAR search and dependency download from the Maven repository](/logo.png)
com.van.logging.utils.PublishHelperUtils Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of appender-core Show documentation
Show all versions of appender-core Show documentation
Core functionality to send content to various channels
package com.van.logging.utils;
import com.van.logging.IStorageDestinationAdjuster;
/**
* Helper utils for publishing.
*/
public class PublishHelperUtils {
/**
* Adjust the path for storage upload if necessary.
*
* @param originalPath the original path to use.
* @param adjuster an optional adjuster that will provide a modification/replacement value for the path
*
* @return the adjusted path (may be equal to originalPath).
*
* Note that if the adjuster returned null, then the original path is returned
*
* Lastly, however the result is achieved (either from the adjuster or the original path), if the value is null,
* then "" will be returned.
*/
public static String adjustStoragePathIfNecessary(String originalPath, IStorageDestinationAdjuster adjuster) {
String path = originalPath;
if (null != adjuster) {
String newPath = adjuster.adjustPath(path);
if (null != newPath) {
path = newPath;
}
}
if (null == path) {
path = "";
}
return path;
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy