public final class Packages extends Object
| Modifier and Type | Method and Description |
|---|---|
static String |
absolutePath(Class<?> p,
String path)
Takes a package and a path to a resource and returns an absolute path to the resource.
|
static String |
absolutePath(Package p,
String relativePath)
Takes a package and a path to a resource and returns an absolute path to the resource.
|
static String |
absolutePath(String packageName,
String path)
Takes a package and a path to a resource and returns an absolute path to the resource.
|
static String |
extractPackageName(Class<?> forClass)
Determines the package name for the given class.
|
static String |
parent(String packageName)
Gets the parent package name.
|
static String |
resolveScope(Class<?> forClass)
Resolve scope for the given class by extracting it's package name and converting all dots to
slashes.
|
public static String absolutePath(Class<?> p, String path)
See absolutePath(String, String) for details.
p - The package to start atpath - The path to the resourcepublic static String absolutePath(Package p, String relativePath)
See absolutePath(String, String) for details.
p - The package to start atrelativePath - The path to the resourcepublic static String absolutePath(String packageName, String path)
Note: The returned absolute path does not start with a slash ("/").
packageName - The package to start atpath - The path to the resourcepublic static String extractPackageName(Class<?> forClass)
forClass - the classpublic static String parent(String packageName)
packageName - The Package nameCopyright © 2006–2015 Apache Software Foundation. All rights reserved.