|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjp.sourceforge.simplefh.util.FileResourceUtil
public class FileResourceUtil
Utility for file resource.
Constructor Summary | |
---|---|
FileResourceUtil()
|
Method Summary | |
---|---|
static void |
close(BufferedInputStream bis)
Close resource safely. |
static void |
close(BufferedReader br)
Close resource safely. |
static void |
close(FileOutputStream fos)
Close resource safely. |
static void |
close(InputStream is)
Close resource safely. |
static void |
close(InputStreamReader isr)
Close resource safely. |
static String |
getDetectedEncoding(InputStream is)
Get detected encoding. |
static String |
getFileSystemAbsolutePath(String resourcePathOrFilePath)
Get file system absolute path. |
static InputStream |
getInputStreamFromResourceOrFileSystem(String resourcePathOrFilePath)
Get InputStream from resource path or file system full path. |
static String |
getResourceRootPath(String resourcePath,
String absolutePath)
Get Resource root path. |
static boolean |
isFileAccessAvailable(String absolutePath)
Judge target absolute path is available to access on os file system. |
static String |
replaceAllBackSlash2Slash(String absolutePath)
Replace all back slash to slash. (for convert Windows platform directory separator) |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public FileResourceUtil()
Method Detail |
---|
public static boolean isFileAccessAvailable(String absolutePath)
absolutePath
- target file absolute path
public static String getDetectedEncoding(InputStream is) throws IOException
is
-
IOException
public static String replaceAllBackSlash2Slash(String absolutePath)
target
- target absolute file path
public static String getFileSystemAbsolutePath(String resourcePathOrFilePath)
resourcePathOrFilePath
- target path(fs path or resource path)
public static String getResourceRootPath(String resourcePath, String absolutePath)
resourcePath
- resource pathabsolutePath
- file system absolute path
public static InputStream getInputStreamFromResourceOrFileSystem(String resourcePathOrFilePath) throws FileNotFoundException
resourcePathOrFilePath
-
FileNotFoundException
public static void close(InputStream is)
is
- InputStream resource objectpublic static void close(InputStreamReader isr)
isr
- InputStreamReader resource objectpublic static void close(BufferedReader br)
br
- BufferedReader resource objectpublic static void close(BufferedInputStream bis)
bis
- BufferedInputStream resource objectpublic static void close(FileOutputStream fos)
bis
- FileOutputStream resource object
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |