@Override
   protected boolean checkResource(URL resource)
   {
      URLConnection connection = null;
      try
      {
         if (LOG.isDebugEnabled())
            LOG.debug("Try to load resource from URL : " + resource);

         connection = resource.openConnection();
         connection.getInputStream().close();

         return true;
      }
      catch (IOException e)
      {
         if (LOG.isDebugEnabled())
            LOG.debug("Can't open URL : " + resource);

         return false;
      }
      finally
      {
         if (connection != null && resource != null && "jcr".equals(resource.getProtocol()))
            ((JcrURLConnection)connection).disconnect();
      }
   }
@ Override protected boolean checkResource ( URL resource ) { URLConnection connection = null ; try { if ( LOG . isDebugEnabled ( ) ) LOG . debug ( "Try to load resource from URL : " + resource ) ; connection = resource . openConnection ( ) ; connection . getInputStream ( ) . close ( ) ; return true ; } catch ( IOException e ) { if ( LOG . isDebugEnabled ( ) ) LOG . debug ( "Can't open URL : " + resource ) ; return false ; } finally { if ( connection != null && resource != null && "jcr" . equals ( resource . getProtocol ( ) ) ) ( ( JcrURLConnection ) connection ) . disconnect ( ) ; } }
@see org.exoplatform.services.rest.ext.groovy.DefaultGroovyResourceLoader#checkResource(java.net.URL)