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 resourcePath) throws IOException
      Throws:
      IOException
    • readAsString

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

      public static void copyResource(String classpath, File out) throws IOException
      Copy a resource from the classpath into a file
      Parameters:
      classpath - The classpath specification
      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)