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
Post a Comment