Class WebResourceReader

java.lang.Object
org.eclnt.jsfserver.util.WebResourceReader

public class WebResourceReader extends Object
Access to web application's file system through the servlet context.
  • Constructor Details

    • WebResourceReader

      public WebResourceReader()
  • Method Details

    • intialize

      public static void intialize(javax.servlet.ServletContext servletContext)
    • readUTF8FileIntoString

      public static String readUTF8FileIntoString(String resourcePath)
      Reads one file from servlet context. The enoding used for encoding the string is UTF-8.
    • readUTF8FileIntoString

      public static String readUTF8FileIntoString(String resourcePath, javax.servlet.ServletContext servletContext, boolean withError)
      Reads one file from servlet context. The enoding used for encoding the string is UTF-8.
    • readUTF8FileIntoString

      public static String readUTF8FileIntoString(String resourcePath, boolean withError)
    • readFileIntoByteArray

      public static byte[] readFileIntoByteArray(String resourcePath)
      Reads one file from servlet context.
    • checkIfFileExists

      public static boolean checkIfFileExists(String resourcePath)
    • readFileIntoInputStream

      public static InputStream readFileIntoInputStream(String resourcePath, boolean withError)
    • readFileIntoInputStream

      public static InputStream readFileIntoInputStream(String resourcePath, javax.servlet.ServletContext servletContext, boolean withError)
    • readFileIntoByteArray

      public static byte[] readFileIntoByteArray(String resourcePath, javax.servlet.ServletContext servletContext)
      Reads one file from servlet context.
    • getRealPath

      public static String getRealPath(String path)
      Not supported with all application servers!
      Parameters:
      path -
      Returns:
    • getFilesInPathDirectoryByPattern

      public static List<String> getFilesInPathDirectoryByPattern(String path, String pattern, String extension)
    • getFilesInPathDirectoryByPattern

      public static List<String> getFilesInPathDirectoryByPattern(javax.servlet.ServletContext servletContext, String path, String pattern, String extension)
    • getFilesInPathDirectory

      public static Set<String> getFilesInPathDirectory(String path, String extension)
    • getFilesInPathDirectory

      public static Set<String> getFilesInPathDirectory(String path)
    • getFilesInPathDirectory

      public static Set<String> getFilesInPathDirectory(javax.servlet.ServletContext servletContext, String path, String extension)
    • getDirectoriesInPathDirectory

      public static List<String> getDirectoriesInPathDirectory(String path)