![JAR search and dependency download from the Maven repository](/logo.png)
net.abstractfactory.plum.view.web.WebFileUtils Maven / Gradle / Ivy
package net.abstractfactory.plum.view.web;
import java.util.Map;
import org.apache.commons.lang3.RandomUtils;
import net.abstractfactory.plum.input.value.File;
public class WebFileUtils {
public static final String PARAMETER_FILE = "_plum_file";
public static String generateUrl(String componentId, String shortName) {
long rand = RandomUtils.nextLong(0, Long.MAX_VALUE);
String imageTagName = String.format("%s_%s", componentId, shortName);
return String.format("?%s=%s&random=%d", PARAMETER_FILE, imageTagName,
rand);
}
public static String generateUrl(String componentId, String shortName,
String version) {
String imageTagName = String.format("%s_%s", componentId, shortName);
return String.format("?%s=%s&version=%s", PARAMETER_FILE, imageTagName,
version);
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy