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

plot - Remove Objects from Legend When You Have Also Used Fit, Matlab -

java - Why does my date parsing return a weird date? -

Need help in packaging app using TideSDK on Windows -