Package ch.qos.logback.core.util

# Class LocationUtil

java.lang.Object
ch.qos.logback.core.util.LocationUtil

public class LocationUtil extends Object
A static utility method that converts a string that describes the location of a resource into a `URL` object.

Author:
  Carl Harris

## Field Summary

Fields
Modifier and Type
Field
Description
`static final String`
`CLASSPATH_SCHEME`
Scheme name for a classpath resource
`static final String`
`SCHEME_PATTERN`
Regex pattern for a URL scheme (reference RFC 2396 section 3)

## Constructor Summary

Constructors
Constructor
Description
`LocationUtil()`

## Method Summary

Modifier and Type
Method
Description
`static URL`
`urlForResource(String location)`
Converts a string describing the location of a resource into a URL object.

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

## Field Details

### SCHEME_PATTERN

public static final String SCHEME_PATTERN
Regex pattern for a URL scheme (reference RFC 2396 section 3)

See Also:
  - Constant Field Values

### CLASSPATH_SCHEME

public static final String CLASSPATH_SCHEME
Scheme name for a classpath resource

See Also:
  - Constant Field Values

## Constructor Details

### LocationUtil

public LocationUtil()

## Method Details

### urlForResource

public static URL urlForResource(String location) throws MalformedURLException, FileNotFoundException
Converts a string describing the location of a resource into a URL object.

Parameters:
  `location` - String describing the location
Returns:
  URL object that refers to `location`
Throws:
  `MalformedURLException` - if `location` is not a syntatically valid URL
  `FileNotFoundException` - if `location` specifies a non-existent classpath resource
  `NullPointerException` - if `location` is `null`