2020import java .io .IOException ;
2121import java .io .InputStream ;
2222import java .io .OutputStream ;
23- import java .io .OutputStreamWriter ;
2423import java .io .UnsupportedEncodingException ;
2524import java .net .URI ;
2625import java .net .URISyntaxException ;
@@ -50,10 +49,11 @@ protected void doGet(HttpServletRequest request, HttpServletResponse response) t
5049
5150 if ( requestUrl != null && !requestUrl .isEmpty () ) {
5251
52+ String formatString = null ;
5353 try {
5454 response .setContentType ( "image/png" );
5555
56- String formatString = requestUrl .substring ( requestUrl .indexOf ("res/icon/" ) + 9 );
56+ formatString = requestUrl .substring ( requestUrl .indexOf ("res/icon/" ) + 9 );
5757 LOGGER .debug ("format: " , formatString );
5858
5959 URI format = new URI ( formatString );
@@ -71,24 +71,11 @@ protected void doGet(HttpServletRequest request, HttpServletResponse response) t
7171 response .flushBuffer ();
7272
7373 } catch (IOException e ) {
74- // TODO Auto-generated catch block
75- e .printStackTrace ();
74+ LOGGER .error (e , "IOException while loading icon" );
7675 } catch (URISyntaxException e ) {
77- // TODO Auto-generated catch block
78- e .printStackTrace ();
76+ LOGGER .warn (e , "Not able to generate URL for Iconizer: " , formatString );
7977 }
8078
81-
82- }
83-
84- try {
85- OutputStream output = response .getOutputStream ();
86- new OutputStreamWriter (output ).append ("Hello World" );
87- output .close ();
88- response .flushBuffer ();
89- } catch (IOException e ) {
90- // TODO Auto-generated catch block
91- e .printStackTrace ();
9279 }
9380
9481 }
0 commit comments