> On Aug. 7, 2012, 11:44 a.m., Nitin Mehta wrote: > > server/src/com/cloud/vm/UserVmManagerImpl.java, line 2487 > > <https://reviews.apache.org/r/6428/diff/1/?file=135087#file135087line2487> > > > > On second thought can you please find out if we can use > > org.apache.commons.codec.binary.Base64 class to check if it is base 64 > > instead of the regular expression here ? > > > > Use function isBase64 from the link below > > > > http://commons.apache.org/codec/apidocs/org/apache/commons/codec/binary/Base64.html#decodeBase64%28byte[]%29
I looked into that but the only check it performs is if all the characters in the data belongs to the valid character-set. Though there is no definite way to check if a text is base64 encoded the regular expression seems to be the most appropriate. - Likitha ----------------------------------------------------------- This is an automatically generated e-mail. To reply, visit: https://reviews.apache.org/r/6428/#review9954 ----------------------------------------------------------- On Aug. 7, 2012, 9:37 a.m., Likitha Shetty wrote: > > ----------------------------------------------------------- > This is an automatically generated e-mail. To reply, visit: > https://reviews.apache.org/r/6428/ > ----------------------------------------------------------- > > (Updated Aug. 7, 2012, 9:37 a.m.) > > > Review request for cloudstack and Prachi Damle. > > > Description > ------- > > Error out with InvalidParameterValueException in UserVmManagerImpl if > userdata is not base64 encoded. > > > This addresses bug CS-14796. > > > Diffs > ----- > > server/src/com/cloud/vm/UserVmManagerImpl.java f441c72 > > Diff: https://reviews.apache.org/r/6428/diff/ > > > Testing > ------- > > > Thanks, > > Likitha Shetty > >