java - FileSystemView get war file icon null pointer -


i using javax.swing.chooser.filesystemview system file icons , display them uploaded files in web application.

it working various file types, when trying upload .war file, java returning null pointer exception. how can know if particular file type supported or not method?

anyone had similar issue?

this code using

// gets 16x16 size image icon list view  icon smallicon = filesystemview.getfilesystemview().getsystemicon(file); image smallimage = ((imageicon) smallicon).getimage(); 

i running code on windows 7 machine if makes difference.

thanks :)

edit: turns out problem wasn't icon. have line of code

string contenttype = getservletcontext().getmimetype(file.getname()); 

which accepts file uploaded parameter , checks type of file. doing check if file image or not. case of war file returning null reason


Comments

Popular posts from this blog

image - ClassNotFoundException when add a prebuilt apk into system.img in android -

I need to import mysql 5.1 to 5.5? -

Java, Hibernate, MySQL - store UTC date-time -