All Downloads are FREE. Search and download functionalities are using the official Maven repository.

net.abstractfactory.plum.view.web.WebFileUtils Maven / Gradle / Ivy

There is a newer version: 0.3.21
Show newest version
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