Relative Content

Tag Archive for javapath

Java Path.getName() truncating encoded percent sign

.Net dev here, somewhat new to java. I have the following snippet of code. I’m trying to get the last segment of the the encoded url, but as you can see it’s cutting off the trailing “%25” and making that just “%”. That causes the URlDecoder.Decode to fail because the string is no longer properly encoded.

Java Path.getName() truncating encoded percent sign

.Net dev here, somewhat new to java. I have the following snippet of code. I’m trying to get the last segment of the the encoded url, but as you can see it’s cutting off the trailing “%25” and making that just “%”. That causes the URlDecoder.Decode to fail because the string is no longer properly encoded.