Class FileAsset

java.lang.Object
org.jboss.shrinkwrap.api.asset.FileAsset
All Implemented Interfaces:
Asset

public class FileAsset extends Object implements Asset
Implementation of an Asset backed by a File
  • Field Details

    • file

      private File file
  • Constructor Details

  • Method Details

    • openStream

      public InputStream openStream()
      Opens a new FileInputStream for the given File. Can throw a Runtime exception if the file has been deleted in between the FileResource was created and the stream is opened.
      Specified by:
      openStream in interface Asset
      Returns:
      A new open InputStream for each call
      Throws:
      RuntimeException - If the file is not found.
    • getSource

      public File getSource()
      Returns the loaded file.
    • toString

      public String toString()
      Overrides:
      toString in class Object
      See Also: