Package org.eclnt.jsfserver.util
Class WebResourceReader
java.lang.Object
org.eclnt.jsfserver.util.WebResourceReader
Access to web application's file system through the servlet
context.
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic boolean
checkIfFileExists
(String resourcePath) getFilesInPathDirectory
(String path, String extension) getFilesInPathDirectory
(javax.servlet.ServletContext servletContext, String path, String extension) getFilesInPathDirectoryByPattern
(String path, String pattern, String extension) getFilesInPathDirectoryByPattern
(javax.servlet.ServletContext servletContext, String path, String pattern, String extension) static String
getRealPath
(String path) Not supported with all application servers!static void
intialize
(javax.servlet.ServletContext servletContext) static byte[]
readFileIntoByteArray
(String resourcePath) Reads one file from servlet context.static byte[]
readFileIntoByteArray
(String resourcePath, javax.servlet.ServletContext servletContext) Reads one file from servlet context.static InputStream
readFileIntoInputStream
(String resourcePath, boolean withError) static InputStream
readFileIntoInputStream
(String resourcePath, javax.servlet.ServletContext servletContext, boolean withError) static String
readUTF8FileIntoString
(String resourcePath) Reads one file from servlet context.static String
readUTF8FileIntoString
(String resourcePath, boolean withError) static String
readUTF8FileIntoString
(String resourcePath, javax.servlet.ServletContext servletContext, boolean withError) Reads one file from servlet context.
-
Constructor Details
-
WebResourceReader
public WebResourceReader()
-
-
Method Details
-
intialize
public static void intialize(javax.servlet.ServletContext servletContext) -
readUTF8FileIntoString
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
-
readFileIntoByteArray
Reads one file from servlet context. -
checkIfFileExists
-
readFileIntoInputStream
-
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
Not supported with all application servers!- Parameters:
path
-- Returns:
-
getFilesInPathDirectoryByPattern
-
getFilesInPathDirectoryByPattern
-
getFilesInPathDirectory
-
getFilesInPathDirectory
-
getFilesInPathDirectory
-
getDirectoriesInPathDirectory
-