Here you can find the source of generateUniqueId()
public static String generateUniqueId()
//package com.java2s; //License from project: Apache License import java.util.UUID; public class Main { public String GenerateUniqueID(String URI_) { if (URI_.endsWith("#id")) { String URI = URI_; URI = URI.replaceAll("[0-9]+/*\\.*[0-9]*", generateUniqueId()); return URI; }// w w w. ja v a 2 s . c om return URI_; } public static String generateUniqueId() { UUID idOne = UUID.randomUUID(); String str = "" + idOne; int uid = str.hashCode(); String filterStr = "" + uid; str = filterStr.replaceAll("-", ""); return str; } }