Recently, I tried to write a piece of code that uploads my file directly to Google docs (I'm so in love with Google :-x) and I needed the mime type of the file I intended to upload , to my surprise, default packages in JDK does not return correct mimeTypes e.g java.net.FileNameMap.
Java by default returns 'application/octet-stream' as Microsoft word document mime type instead of 'application/msword'. This however causes an exception
ServiceException: com.google.gdata.util.InvalidEntryException: Bad Request Content-Type application/octet-stream is not a valid media type
Strange isn't it? I also tried a couple of Classes that uses JAVA_HOME/lib/content-types.properties file. The is my solution perhaps you alsi have similar troubles like me.
2. Open a command prompt and type java -jar install-ocutil-2.4.2.jar
3. Follow the instructions and choose default installation path
4. Add C:\Program Files\clapper.org\util\lib\ocutil-2.4.2.jar to your application- In Netbeans IDE 6.5 you may follow these steps
5. Right click on Library of your project node
6. Click on Add JAR/Folder... and select C:\Program Files\clapper.org\util\lib\ocutil-2.4.2.jar
Please when adding hefty lib like gdata client libary you may want to create a library using library manager and then import. See getting started with Java and google soon in my next blog :-)
7. You may test using this sample code I have written, Note that org.clapper.util.misc.MIMETypeUtil was imported.
This documentation is intended to help quickly configure the TUT(Tshwane university of technology, SA) ITS connection. ITS connection is simply the Oracle database connection that TUT uses to store all crucial information about student and staff of TUT. This documentation hereby written for a simple purpose of connecting to this database to read information stored on TUT database.
PURPOSE
This documentation may be used by anyone testing, trying or wanting to build applications that connects to an oracle database system and also to help configure or recompile oracle(OCI8 installation with world’s powerful server scripting language php) on a LINUX OS.
HARDWARE AND SPECIFIIC CONFIG
OS:Linux
DISTRO: Centos
VERSION: 5
NEEDED TOOLS OR SOFTWARE
At the time of writing, the following versions were used