Klasse JavaResource

java.lang.Object
ch.bailu.gtk.lib.util.JavaResource

public class JavaResource extends Object
Util class for location-independent access to program specific resources. To read files from "resources/" or from the applications jar archive
  • Konstruktordetails

    • JavaResource

      public JavaResource(String path)
      Creates a JavaResource object holding a relative path to a file in "resources/" or the root directory of the jar archive
      Parameter:
      path - absolute path to css resource: "/css/app.css"
  • Methodendetails

    • asString

      public String asString() throws IOException
      Read entire text resource into string
      Gibt zurück:
      String containing the entire text resource
      Löst aus:
      IOException - If file does not exist
    • asStream

      public InputStream asStream() throws IOException
      Open the program specific resource file and return it as a readable stream
      Gibt zurück:
      InputStream for reading resource file
      Löst aus:
      IOException - If file does not exist
    • asBytes

      public Bytes asBytes() throws IOException
      Löst aus:
      IOException