• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

org.apache.tomcat.util.codec.binary.Base64 - which jar?

 
Ranch Hand
Posts: 214
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I've been looking at alternatives for the sun.misc.BASE64Encoder/Decoder (Java 7 / Tomcat 7). Specifically, built-in classes (so no external libs are required). I found the class javax.xml.bind.DatatypeConverter which offers Base64 encoding/decoding methods.

But I also remembered having seen a Base64 class in the tomcat API, and on searching indeed found it: org.apache.tomcat.util.codec.binary.Base64 (see http://tomcat.apache.org/tomcat-7.0-doc/api/).

However, where is this class? I mean, which jar contains it? I looked into tomcat-api.jar, tomcat-util.jar, tomcat-coyote.jar and several more, but could not find it. catalina.jar contains another Base64 class (org.apache.catalina.util.Base64), which is something else. Maybe I'm blind but I don't see it anywhere.

Does anyone know where the class is hidden?
 
Rancher
Posts: 43081
77
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Don't use any of the Tomcat classes in your web app. Instead, download the original from commons.apache.org/codec.
 
D. Ogranos
Ranch Hand
Posts: 214
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hmm, any good reason why not? I understand that things might change between versions, but its not like you change server versions every other day in a production system.

The only reason I was looking at this class was because I thought it was available in the context of a basic Java 7 / Tomcat 7 installation, without having to add any more .jar dependencies.
 
Saloon Keeper
Posts: 27819
196
Android Eclipse IDE Tomcat Server Redhat Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

D. Ogranos wrote:Hmm, any good reason why not? I understand that things might change between versions, but its not like you change server versions every other day in a production system.

The only reason I was looking at this class was because I thought it was available in the context of a basic Java 7 / Tomcat 7 installation, without having to add any more .jar dependencies.



For the same reason that there are thousands of apps out in the world that spew out deprecation messages when compiled because they thought that they could use the proprietary Sun code. And then some.

You may not upgrade a server every day, but I have a list of servers on Tomcat 6 that are overdue to go to Tomcat 7 and probably won't all get done until Tomcat 8 shows up. Tomcat 7 is a LOT different than Tomcat6, and it's bad enough doing "transparent" server upgrades without having to stop and hack on all the apps at the same time. I mean, if you really want stuff that breaks dependencies every other week, that's what Windows is for. Java was designed with the idea that you're a serious enterprise with hundreds, maybe thousands of apps and you don't have time or resources to constantly baby-sit them all.

Besides, the Apache projects are constructed in such a way that you can specify a given release dependency and hold to it until you are ready to move up. I did that, in fact, just yesterday, and most of the day consisted of finding out what new releases of what were required if I updated this other thing.

It beats "DLL Hell", but not by much.
 
D. Ogranos
Ranch Hand
Posts: 214
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks for the answer. I'm not trying to avoid dependencies like the plague, but here I was hoping for a more accessible solution ;)
reply
    Bookmark Topic Watch Topic
  • New Topic