|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.red5.server.util.FileUtil
public class FileUtil
Generic file utility containing useful file or directory manipulation functions.
Constructor Summary | |
---|---|
FileUtil()
|
Method Summary | |
---|---|
static void |
copy(InputStream in,
OutputStream out)
|
static void |
copyFile(File source,
File dest)
|
static void |
copyFile(String source,
String dest)
|
static boolean |
deleteDirectory(String directory)
Deletes a directory and its contents. |
static boolean |
deleteDirectory(String directory,
boolean useOSNativeDelete)
Deletes a directory and its contents. |
static String |
formatPath(String absWebappsPath,
String contextDirName)
Quick-n-dirty directory formatting to support launching in windows, specifically from ant. |
static String |
generateCustomName()
Generates a custom name containing numbers and an underscore ex. |
static boolean |
makeDirectory(String directory)
Create a directory. |
static boolean |
makeDirectory(String directory,
boolean createParents)
Create a directory. |
static void |
moveFile(String source,
String dest)
|
static byte[] |
readAsByteArray(File localSwfFile)
Reads all the bytes of a given file into an array. |
static void |
rename(String from,
String to)
Rename a file natively; using REN on Windows and mv on *nix. |
static void |
unzip(String compressedFileName,
String destinationDir)
Unzips a war file to an application located under the webapps directory |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public FileUtil()
Method Detail |
---|
public static void copyFile(File source, File dest) throws IOException
IOException
public static void copyFile(String source, String dest) throws IOException
IOException
public static void moveFile(String source, String dest) throws IOException
IOException
public static boolean deleteDirectory(String directory) throws IOException
directory
- directory to delete
IOException
- if directory cannot be deletedpublic static boolean deleteDirectory(String directory, boolean useOSNativeDelete) throws IOException
directory
- directory to deleteuseOSNativeDelete
- flag to signify use of operating system delete function
IOException
- if directory cannot be deletedpublic static void rename(String from, String to)
from
- old nameto
- new namepublic static boolean makeDirectory(String directory) throws IOException
directory
- directory to make
IOException
- if directory does not already exist or cannot be madepublic static boolean makeDirectory(String directory, boolean createParents) throws IOException
directory
- directorycreateParents
- whether to create all parents
IOException
- if we cannot create directorypublic static void unzip(String compressedFileName, String destinationDir)
compressedFileName
- The String name of the war filedestinationDir
- The destination directory, ie: webappspublic static void copy(InputStream in, OutputStream out) throws IOException
IOException
public static String formatPath(String absWebappsPath, String contextDirName)
absWebappsPath
- abs webapps pathcontextDirName
- conext directory name
public static String generateCustomName()
public static byte[] readAsByteArray(File localSwfFile)
localSwfFile
-
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |