Class Sources

java.lang.Object
org.projecthusky.common.utils.Sources

public class Sources extends Object
Utilities to create Sources.
Author:
Quentin Ligier
  • Method Details

    • fromFile

      public static Source fromFile(File file)
      Creates a Source from a File.
      Parameters:
      file - The file.
      Returns:
      the source.
    • fromInputStream

      public static Source fromInputStream(InputStream inputStream)
      Creates a Source from an input stream.
      Parameters:
      inputStream - The input stream.
      Returns:
      the source.
    • fromByteArray

      public static Source fromByteArray(byte[] bytes)
      Creates a Source from a byte array.
      Parameters:
      bytes - The byte array.
      Returns:
      the source.
    • fromString

      public static Source fromString(String string)
      Creates a Source from a UTF-8 string.
      Parameters:
      string - The UTF-8 string.
      Returns:
      the source.
    • fromDomDocument

      public static Source fromDomDocument(Document document)
      Creates a Source from a DOM document.
      Parameters:
      document - The DOM document.
      Returns:
      the source.