protected static URL getUrlForStringFromClasspathAsFileOrUrl(String logbackConfigurationFile) {

        URL url = null;

        try {
            url = Resources.getResource(logbackConfigurationFile);
        } catch (IllegalArgumentException ex) {
            // doing nothing intentionally..
        }

        if (url == null) {
            // configuring from file:
            try {
                File file = new File(logbackConfigurationFile);
                
                if (file.exists()) {
                    url = new File(logbackConfigurationFile).toURI().toURL();
                }
                
            } catch (MalformedURLException ex) {
                // doing nothing intentionally..
            }

        }

        if (url == null) {
            try {
                // we assume we got a real http://... url here...
                url = new URL(logbackConfigurationFile);
            } catch (MalformedURLException ex) {
                // doing nothing intentionally..
            }

        }

        return url;
    }
protected static URL getUrlForStringFromClasspathAsFileOrUrl(String logbackConfigurationFile) {

        URL url = null;

        try {
            url = Resources.getResource(logbackConfigurationFile);
        } catch (IllegalArgumentException ex) {
            
        }

        if (url == null) {
            
            try {
                File file = new File(logbackConfigurationFile);
                
                if (file.exists()) {
                    url = new File(logbackConfigurationFile).toURI().toURL();
                }
                
            } catch (MalformedURLException ex) {
                
            }

        }

        if (url == null) {
            try {
                
                url = new URL(logbackConfigurationFile);
            } catch (MalformedURLException ex) {
                
            }

        }

        return url;
    }
protected static URL getUrlForStringFromClasspathAsFileOrUrl ( String logbackConfigurationFile ) { URL url = null ; try { url = Resources . getResource ( logbackConfigurationFile ) ; } catch ( IllegalArgumentException ex ) { // doing nothing intentionally.. } if ( url == null ) { // configuring from file: try { File file = new File ( logbackConfigurationFile ) ; if ( file . exists ( ) ) { url = new File ( logbackConfigurationFile ) . toURI ( ) . toURL ( ) ; } } catch ( MalformedURLException ex ) { // doing nothing intentionally.. } } if ( url == null ) { try { // we assume we got a real http://... url here... url = new URL ( logbackConfigurationFile ) ; } catch ( MalformedURLException ex ) { // doing nothing intentionally.. } } return url ; }
Looks up a potential file from
1) The classpahth
2) From the filesystem
3) From an URL

@param logbackConfigurationFile
@return null if not found or a valid url created from the logbackConfigurationFile
Looks up a potential file from 1 ) The classpahth 2 ) From the filesystem 3 ) From an URL