Package com.liferay.portal.kernel.util
Class FileUtil
Object
com.liferay.portal.kernel.util.FileUtil
- Author:
- Brian Wing Shun Chan, Alexander Chow
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic String
appendParentheticalSuffix
(String fileName, String suffix) static String
appendSuffix
(String fileName, String suffix) static void
copyDirectory
(File source, File destination) static void
copyDirectory
(String sourceDirName, String destinationDirName) static void
static void
static File
static File
createTempFile
(byte[] bytes) static File
createTempFile
(InputStream inputStream) static File
createTempFile
(String extension) static File
createTempFile
(String prefix, String extension) static String
static String
createTempFileName
(String extension) static String
createTempFileName
(String prefix, String extension) static File
static String
decodeSafeFileName
(String fileName) static boolean
static boolean
static void
static void
static String
encodeSafeFileName
(String fileName) static boolean
static boolean
static String
getAbsolutePath
(File file) static byte[]
static byte[]
getBytes
(InputStream inputStream) static byte[]
getBytes
(InputStream inputStream, int bufferSize) static byte[]
getBytes
(InputStream inputStream, int bufferSize, boolean cleanUpStream) static byte[]
static String
getExtension
(String fileName) static File
getFile()
static String
getMD5Checksum
(File file) static String
static String
getShortFileName
(String fullFileName) static boolean
isSameContent
(File file, byte[] bytes, int length) static boolean
isSameContent
(File file, String s) static String[]
static String[]
static String[]
static String[]
static void
static void
static boolean
static boolean
static String
static String
static String
static String
replaceSeparator
(String fileName) void
static File[]
static String
stripExtension
(String fileName) static String
stripParentheticalSuffix
(String fileName) static Properties
toProperties
(FileInputStream fileInputStream) static Properties
toProperties
(String fileName) static void
static void
static void
static void
static void
static void
static void
static void
write
(File file, InputStream inputStream) static void
static void
static void
static void
static void
write
(String fileName, InputStream inputStream) static void
static void
static void
static void
static void
static void
-
Constructor Details
-
FileUtil
public FileUtil()
-
-
Method Details
-
appendParentheticalSuffix
-
appendSuffix
-
copyDirectory
- Throws:
IOException
-
copyDirectory
public static void copyDirectory(String sourceDirName, String destinationDirName) throws IOException - Throws:
IOException
-
copyFile
- Throws:
IOException
-
copyFile
- Throws:
IOException
-
createTempFile
-
createTempFile
- Throws:
IOException
-
createTempFile
- Throws:
IOException
-
createTempFile
-
createTempFile
-
createTempFileName
-
createTempFileName
-
createTempFileName
-
createTempFolder
- Throws:
IOException
-
decodeSafeFileName
-
delete
-
delete
-
deltree
-
deltree
-
encodeSafeFileName
-
exists
-
exists
-
getAbsolutePath
-
getBytes
- Throws:
Exception
-
getBytes
- Throws:
IOException
-
getBytes
- Throws:
IOException
-
getBytes
- Throws:
IOException
-
getBytes
public static byte[] getBytes(InputStream inputStream, int bufferSize, boolean cleanUpStream) throws IOException - Throws:
IOException
-
getExtension
-
getFile
-
getMD5Checksum
- Throws:
IOException
-
getPath
-
getShortFileName
-
isSameContent
-
isSameContent
-
listDirs
-
listDirs
-
listFiles
-
listFiles
-
mkdirs
-
mkdirs
-
move
-
move
-
read
- Throws:
IOException
-
read
- Throws:
IOException
-
read
- Throws:
IOException
-
replaceSeparator
-
sortFiles
-
stripExtension
-
stripParentheticalSuffix
-
toList
-
toList
-
toProperties
-
toProperties
-
touch
- Throws:
IOException
-
touch
- Throws:
IOException
-
unzip
-
write
- Throws:
IOException
-
write
- Throws:
IOException
-
write
- Throws:
IOException
-
write
public static void write(File file, byte[] bytes, int offset, int length, boolean append) throws IOException - Throws:
IOException
-
write
- Throws:
IOException
-
write
- Throws:
IOException
-
write
- Throws:
IOException
-
write
- Throws:
IOException
-
write
- Throws:
IOException
-
write
- Throws:
IOException
-
write
- Throws:
IOException
-
write
- Throws:
IOException
-
write
public static void write(String fileName, String s, boolean lazy, boolean append) throws IOException - Throws:
IOException
-
write
- Throws:
IOException
-
write
public static void write(String pathName, String fileName, String s, boolean lazy) throws IOException - Throws:
IOException
-
write
public static void write(String pathName, String fileName, String s, boolean lazy, boolean append) throws IOException - Throws:
IOException
-
setFile
-