Class ResourceUtil

java.lang.Object
com.logicaldoc.util.io.ResourceUtil

public class ResourceUtil extends Object
Utiliry class for classpath resources IO issues
Since:
4.5
Author:
Matteo Caruso - LogicalDOC
  • Method Details

    • readAsBytes

      public static byte[] readAsBytes(String resourceName) throws IOException
      Throws:
      IOException
    • readAsString

      public static String readAsString(String resourceName) throws IOException
      Throws:
      IOException
    • copyResource

      public static void copyResource(String resourceName, File out) throws IOException
      Copy a resource from the classpath into a file
      Parameters:
      resourceName - The resource fully qualified name
      out - The target file
      Throws:
      IOException - raised in case the resource does not exist or the output file cannot be written
    • existsResource

      public static boolean existsResource(String resourceName)
    • getInputStream

      public static InputStream getInputStream(String resourceName)