public class CodeLocations
extends java.lang.Object
Modifier and Type | Class and Description |
---|---|
static class |
CodeLocations.InvalidCodeLocation |
Constructor and Description |
---|
CodeLocations() |
Modifier and Type | Method and Description |
---|---|
static java.net.URL |
codeLocationFromClass(java.lang.Class<?> codeLocationClass)
Creates a code location URL from a class
|
static java.net.URL |
codeLocationFromPath(java.lang.String filePath)
Creates a code location URL from a file path
|
static java.net.URL |
codeLocationFromURL(java.lang.String url)
Creates a code location URL from a URL
|
static java.lang.String |
getPathFromURL(java.net.URL url)
Get absolute path from URL objects starting with file:
This method takes care of decoding %-encoded chars, e.g.
|
public static java.net.URL codeLocationFromClass(java.lang.Class<?> codeLocationClass)
codeLocationClass
- the classCodeLocations.InvalidCodeLocation
- if URL creation failspublic static java.net.URL codeLocationFromPath(java.lang.String filePath)
filePath
- the file pathCodeLocations.InvalidCodeLocation
- if URL creation failspublic static java.net.URL codeLocationFromURL(java.lang.String url)
url
- the URL external formCodeLocations.InvalidCodeLocation
- if URL creation failspublic static java.lang.String getPathFromURL(java.net.URL url)
url
- the file-URLCodeLocations.InvalidCodeLocation
- if URL contains format errorsCopyright © 2003-2014. All Rights Reserved.