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 is copied from nl.tudelft.simulation.language.io.
Copyright (c) 2002-2019 Delft University of Technology, Jaffalaan 5, 2628 BX Delft, the Netherlands. All rights reserved.
See for project information www.simulation.tudelft.nl.
The DSOL project is distributed under the following BSD-style license:
Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following
conditions are met:
- Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
- Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
- Neither the name of Delft University of Technology, nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.
- Version:
- May 2, 2014
- Author:
- Peter Jacobs, Alexander Verbraeck
-
Method Summary
Modifier and Type Method Description static URL
getResource(String name)
Resolves a resource for name.static URL
getResource(String name, String base)
Resolves a resource for name.static InputStream
getResourceAsStream(String name)
returns the resource as stream.
-
Method Details
-
getResource
Resolves a resource for name.- Parameters:
name
- String; the name to search for- Returns:
- the resolved URL
-
getResource
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
returns the resource as stream.- Parameters:
name
- String; the name of the resource- Returns:
- the inputStream
-