XEdwin / jcouchdb

Automatically exported from code.google.com/p/jcouchdb
Other
0 stars 0 forks source link

MediaTypeUtil doesn't read mime.types. #64

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
---------------------------
@Grab(group='com.google.code.jcouchdb', module='jcouchdb', version='1.0.1-1')
import org.jcouchdb.util.MediaTypeUtil

File upFile = new File('/Users/kanemu/Desktop/tmpimage/2A082_E0100.jpg')
def mutil = new MediaTypeUtil()
println mutil.getMediaTypeForName(upFile.name)
---------------------------

What is the expected output? What do you see instead?
Expected output -> image/jpeg
instead ->
Caught: java.lang.NullPointerException
        at dbTest2.run(dbTest2.groovy:5)

What version of the product are you using? On what operating system?
jcouchdb 1.0.1-1
Mac OS X 10.5.8
Groovy Version: 1.7.3 JVM: 1.6.0_20

Please provide any additional information below.
---------------------------
@Grab(group='com.google.code.jcouchdb', module='jcouchdb', version='1.0.1-1')
import org.jcouchdb.util.MediaTypeUtil

File upFile = new File('/Users/kanemu/Desktop/tmpimage/2A082_E0100.jpg')
def mutil = new MediaTypeUtil(new 
File("/Users/kanemu/Desktop/mime.types").newDataInputStream())
println mutil.getMediaTypeForName(upFile.name)
---------------------------
This source moves normally. 

Original issue reported on code.google.com by nc.kanam...@gmail.com on 15 Oct 2010 at 5:40

GoogleCodeExporter commented 9 years ago
mime.types is not loaded because it's not actually there :-\ 

fixed error in pom.xml 

Original comment by ff...@gmx.de on 15 Oct 2010 at 9:28