Class Resource

java.lang.Object
org.opentrafficsim.base.Resource

public final class Resource extends Object
Resource utility.

Copyright (c) 2013-2024 Delft University of Technology, PO Box 5, 2600 AA, Delft, the Netherlands. All rights reserved.
BSD-style license. See OpenTrafficSim License.

Author:
Alexander Verbraeck, Peter Knoppers, Wouter Schakel
  • Method Details

    • getResourceAsStream

      public static InputStream getResourceAsStream(String name)
      Obtains stream for resource, either in IDE or java.
      Parameters:
      name - String; name of resource
      Returns:
      the resolved input stream
    • getResourceAsUri

      public static URI getResourceAsUri(String name) throws URISyntaxException
      Obtains URI for resource, either in IDE or java.
      Parameters:
      name - String; name of resource
      Returns:
      the resolved URI
      Throws:
      URISyntaxException - when the file name is malformed.