public static String encodeURN ( String publicId ) { String urn = PublicId . normalize ( publicId ) ; urn = PublicId . stringReplace ( urn , "%" , "%25" ) ; urn = PublicId . stringReplace ( urn , ";" , "%3B" ) ; urn = PublicId . stringReplace ( urn , "'" , "%27" ) ; urn = PublicId . stringReplace ( urn , "?" , "%3F" ) ; urn = PublicId . stringReplace ( urn , "#" , "%23" ) ; urn = PublicId . stringReplace ( urn , "+" , "%2B" ) ; urn = PublicId . stringReplace ( urn , " " , "+" ) ; urn = PublicId . stringReplace ( urn , "::" , ";" ) ; urn = PublicId . stringReplace ( urn , ":" , "%3A" ) ; urn = PublicId . stringReplace ( urn , "//" , ":" ) ; urn = PublicId . stringReplace ( urn , "/" , "%2F" ) ; return "urn:publicid:" + urn ; }
Encode a public identifier as a publicid URN .