0

I am encoding URL request parameters from string to Base64 string using encodeURIComponent() method and passing it to server. Server side in servlet filter i am decoding it from Base64 to string using java.util.Base64.

I am not converting all the requests(request parameters). If the URL contains json request parameters than only I am encoding the request parameter.

Here my problem is I want to check the request parameters is encoded or not.

Can any one suggest me any method is available to identify request parameter is encoded or not.

user3291914
  • 19
  • 1
  • 7

1 Answers1

2

You can use commons method Base64.isBase64(String base64).

It returns a boolean True/False if your string is base64 encoded/or not.

Pankaj Singhal
  • 14,030
  • 9
  • 41
  • 81