| java.lang.Object net.myvietnam.mvncore.util.FileUtil
FileUtil | final public class FileUtil (Code) | | |
Method Summary | |
public static void | checkGoodFileName(String str) | public static void | checkGoodFilePath(String str) | public static void | copyFile(String srcFilename, String destFilename, boolean overwrite) | public static void | createDir(String dir, boolean ignoreIfExitst) | public static void | createDirs(String dir, boolean ignoreIfExitst) | public static void | createTextFile(InputStream inputStream, String textFile) This method create a file text/css
NOTE: This method closes the inputStream after it have done its work. | public static void | deleteDir(File dir) | public static void | deleteFile(String filename) | public static void | emptyFile(String srcFilename) | public static byte[] | getBytes(InputStream inputStream) | public static long | getDirLength(File dir) | public static long | getDirLength_onDisk(File dir) | public static String | getFileName(String fullFilePath) | public static String | getHumanSize(long size) | public static String[] | getLastLines(File file, int linesToReturn) | public static String | getServletClassesPath() This function is used to get the classpath of a reference of one class
First, this method tries to get the path from system properties
named "mvncore.context.path" (can be configed in web.xml). | public static void | popFile(File srcFile, OutputStream output) | public static String | readFile(String fileName, String srcEncoding) | public static void | setServletClassesPath(String path) | public static boolean | touch(String fileName) | public static void | writeFile(String content, String fileName, String destEncoding) |
createTextFile | public static void createTextFile(InputStream inputStream, String textFile) throws IOException(Code) | | This method create a file text/css
NOTE: This method closes the inputStream after it have done its work.
Parameters: inputStream - the stream of a text/css file Parameters: cssFile - the output file, have the ".css" extension or orther extension throws: IOException - throws: BadInputException - |
getHumanSize | public static String getHumanSize(long size)(Code) | | |
getServletClassesPath | public static String getServletClassesPath()(Code) | | This function is used to get the classpath of a reference of one class
First, this method tries to get the path from system properties
named "mvncore.context.path" (can be configed in web.xml). If it cannot
find this parameter, then it will tries to load from the ClassLoader
|
popFile | public static void popFile(File srcFile, OutputStream output) throws IOException(Code) | | This method write srcFile to the output, and does not close the output
Parameters: srcFile - File the source (input) file Parameters: output - OutputStream the stream to write to, this method will not buffered the output throws: IOException - |
setServletClassesPath | public static void setServletClassesPath(String path)(Code) | | This method could be used to override the path to WEB-INF/classes
It can be set when the web app is inited
Parameters: path - String : new path to override the default path |
|
|