@@ -3216,7 +3216,7 @@ private boolean loadCacheFile()
32163216 HttpURLConnection .setFollowRedirects (true );
32173217 URL myURL = (URL ) src ;
32183218 URLConnection myURLConn ;
3219- boolean isSDURL = false ;
3219+ boolean isSDURL = false ; //identifies an Schedules Direct image that needs special handling
32203220 try
32213221 {
32223222 while (true )
@@ -3245,8 +3245,7 @@ private boolean loadCacheFile()
32453245 if (Sage .DBG ) System .out .println ("MetaImage.loadCacheFile: No token so skipping src = '" + src + "'" );
32463246 break ;
32473247 }else {
3248- //TODO: remove the following after testing
3249- if (Sage .DBG ) System .out .println ("MetaImage.loadCacheFile: Adding token to Request. token = '" + sdToken + "'" );
3248+ if (Sage .DBG && SDSession .debugEnabled ()) System .out .println ("MetaImage.loadCacheFile: Adding token to Request. token = '" + sdToken + "'" );
32503249 myURLConn .addRequestProperty ("token" , sdToken );
32513250 myURLConn .setRequestProperty ("User-Agent" , SDSession .USER_AGENT );
32523251 //secret SD debug mode that will send requests to their debug server. Only enable when working with SD Support
@@ -3260,13 +3259,10 @@ private boolean loadCacheFile()
32603259 is = myURLConn .getInputStream ();
32613260 if (myURLConn instanceof HttpURLConnection )
32623261 {
3263- //TODO: SD testing of response code
32643262 HttpURLConnection httpConn = (HttpURLConnection ) myURLConn ;
32653263 if (isSDURL ) {
3266- if (Sage .DBG ) System .out .println ("MetaImage.loadCacheFile: HttpURLConnection response found for SD image - type:" + httpConn .getContentType () + " response code:" + httpConn .getResponseCode ());
32673264 if ("application/json" .equals (httpConn .getContentType ())){
32683265 //SD returned an error which is within the returned json
3269- //TODO: remove after testing
32703266 int imageErrorCode = SDUtils .handleSDJsonErrorFromHttpResponse (httpConn );
32713267 if (imageErrorCode ==1004 ){ //no or invalid token
32723268 is .close ();
0 commit comments