Code example for MalformedURLException

0
    /*  
     */ 
    public Resource getResource(String path) throws MalformedURLException
    { 
        if (path==null || !path.startsWith("/"))
            throw new MalformedURLException(path);
         
        Resource base = _baseResource;
        if (base==null)
        { 
            if (_context==null)
                return null;             
            base=_context.getBaseResource();
            if (base==null)
                return null; 
        } 
 
        try 
        { 
            path=URIUtil.canonicalPath(path);
            Resource resource=base.addPath(path);