0

I need to use javax.activation to get the mimetype of files. I am running embedded glassfish and added the activation jar to the maven plugin as a dependency; however, it is still returning application/octet-stream which indicates to me that the jar is not in the right location.

Any ideas?

Thanks,

Walter

Walter
  • 1,290
  • 2
  • 21
  • 46

1 Answers1

0

I ended up using a better API which actually reads the file type: Apache Tika.

Walter

Walter
  • 1,290
  • 2
  • 21
  • 46
  • Was it provided with the embedded glassfish? – Denys S. Dec 10 '13 at 18:01
  • No, Tika is a solution along with some other one JBoss uses for its content repositories. That is not a spec provided in JavaEE, but something JCR implementations do, so if you follow the bigger JCR implementations, you get Tika and a JBoss one. – Walter Dec 11 '13 at 18:33
  • Ok, but did you need that lib in the embedded glassfish or it didn't matter? – Denys S. Dec 11 '13 at 18:40
  • Oh, I see the confusion - there is primitive support in java itself which I later found to be inadequate, that was the activation jar. No, Tika just needs to be on the classpath for the application that needs it. – Walter Dec 12 '13 at 20:01
  • If you ever end up needing some libs (eclipselink?) in your embedded GF: http://stackoverflow.com/questions/16670701/using-different-eclipselink-than-bundled-in-glassfish-embedded-web/20548417#20548417 – Denys S. Dec 12 '13 at 20:06