Package org.sqlite.util
Class ResourceFinder
- java.lang.Object
-
- org.sqlite.util.ResourceFinder
-
public class ResourceFinder extends java.lang.Object
Resource address finder for files inside the jar file
-
-
Constructor Summary
Constructors Constructor Description ResourceFinder()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static java.net.URL
find(java.lang.Class<?> referenceClass, java.lang.String resourceFileName)
Gets theURL
of the file resourcestatic java.net.URL
find(java.lang.ClassLoader classLoader, java.lang.Package basePackage, java.lang.String resourceFileName)
Finds theURL
of the resourcestatic java.net.URL
find(java.lang.ClassLoader classLoader, java.lang.String packageName, java.lang.String resourceFileName)
Finds theURL
of the resourceprivate static java.lang.String
packagePath(java.lang.Class<?> referenceClass)
private static java.lang.String
packagePath(java.lang.Package basePackage)
private static java.lang.String
packagePath(java.lang.String packageName)
-
-
-
Method Detail
-
find
public static java.net.URL find(java.lang.Class<?> referenceClass, java.lang.String resourceFileName)
Gets theURL
of the file resource- Parameters:
referenceClass
- the base class for finding resources files. This method will search the package containing the given referenceClass.resourceFileName
- the resource file name relative to the package of the referenceClass- Returns:
- the URL of the file resource
-
find
public static java.net.URL find(java.lang.ClassLoader classLoader, java.lang.Package basePackage, java.lang.String resourceFileName)
Finds theURL
of the resource- Parameters:
basePackage
- the base package to find the resourceresourceFileName
- the resource file name relative to the package folder- Returns:
- the URL of the specified resource
-
find
public static java.net.URL find(java.lang.ClassLoader classLoader, java.lang.String packageName, java.lang.String resourceFileName)
Finds theURL
of the resource- Parameters:
packageName
- the base package name to find the resourceresourceFileName
- the resource file name relative to the package folder- Returns:
- the URL of the specified resource
-
packagePath
private static java.lang.String packagePath(java.lang.Class<?> referenceClass)
-
packagePath
private static java.lang.String packagePath(java.lang.Package basePackage)
- Parameters:
basePackage
- Package object- Returns:
- Package path String in the unix-like format.
-
packagePath
private static java.lang.String packagePath(java.lang.String packageName)
- Parameters:
packageName
- Package name string- Returns:
- Package path String in the unix-like format.
-
-