Package org.djunits.generator
Class URLResource
- java.lang.Object
-
- org.djunits.generator.URLResource
-
public final class URLResource extends Object
The URLResource class helps to resolve a file location in a project, JAR, or folder. The static methods return a URL of the file location that was found, or null in case it was not found. This class originates from the DSOL simulation project.Copyright (c) 2002-2022 Delft University of Technology, Jaffalaan 5, 2628 BX Delft, the Netherlands. All rights reserved.
BSD-style license. See DJUNITS License.- Author:
- Alexander Verbraeck
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static URLgetResource(String name)Resolves a resource for name.static URLgetResource(String name, String base)Resolves a resource for name.static InputStreamgetResourceAsStream(String name)returns the resource as stream.
-
-
-
Method Detail
-
getResource
public static URL getResource(String name)
Resolves a resource for name.- Parameters:
name- String; the name to search for- Returns:
- the resolved URL
-
getResource
public static URL getResource(String name, String base)
Resolves a resource for name. For relative names, base is used to resolve to an absolute name. If name is absolute, base is ignored.- Parameters:
name- String; the name to search forbase- String; the base for relative paths- Returns:
- the resolved URL
-
getResourceAsStream
public static InputStream getResourceAsStream(String name)
returns the resource as stream.- Parameters:
name- String; the name of the resource- Returns:
- the inputStream
-
-