Skip to content

Instantly share code, notes, and snippets.

View raykrueger's full-sized avatar

Ray Krueger raykrueger

  • Chicago, IL, USA
View GitHub Profile
import org.apache.commons.codec.binary.Hex;
import java.security.MessageDigest;
import java.security.NoSuchAlgorithmException;
import java.security.SecureRandom;
/**
* @author Ray Krueger
*/
public abstract class SimpleUID {
/**
* @return Returns the timeZone.
*/
public TimeZone getTimeZone() {
return (timeZone != null ? timeZone :
getCurrentUser() != null && getCurrentUser().getTimezone() != null ?
DateUtil.getTimeZone(getCurrentUser().getTimezone()) :
DEFAULT_TIMEZONE != null ? DateUtil.getTimeZone(DEFAULT_TIMEZONE) :
TimeZone.getDefault());
}
public enum HttpStatus {
OK(200),
CREATED(201),
ACCEPTED(202),
NOT_MODIFIED(304),
BAD_REQUEST(400),
UNAUTHORIZED(401),
public class TokenReplacement {
private static final Logger log =
LoggerFactory.getLogger(TokenReplacement.class);
private static final Pattern TOKEN_PATTERN = Pattern.compile("\\$\\{(.*?)\\}");
public static String replaceTokens(final String input, Properties props) {
Matcher matcher = TOKEN_PATTERN.matcher(input);
//hahahaha
synchronized (myCache) {
myCache = cache;
}