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 StringappendParentheticalSuffix(String fileName, String suffix) static StringappendSuffix(String fileName, String suffix) static voidcopyDirectory(File source, File destination) static voidcopyDirectory(String sourceDirName, String destinationDirName) static voidstatic voidstatic Filestatic FilecreateTempFile(byte[] bytes) static FilecreateTempFile(InputStream inputStream) static FilecreateTempFile(String extension) static FilecreateTempFile(String prefix, String extension) static Stringstatic StringcreateTempFileName(String extension) static StringcreateTempFileName(String prefix, String extension) static Filestatic StringdecodeSafeFileName(String fileName) static booleanstatic booleanstatic voidstatic voidstatic StringencodeSafeFileName(String fileName) static booleanstatic booleanstatic StringgetAbsolutePath(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 StringgetExtension(String fileName) static FilegetFile()static StringgetMD5Checksum(File file) static Stringstatic StringgetShortFileName(String fullFileName) static booleanisSameContent(File file, byte[] bytes, int length) static booleanisSameContent(File file, String s) static String[]static String[]static String[]static String[]static voidstatic voidstatic booleanstatic booleanstatic Stringstatic Stringstatic Stringstatic StringreplaceSeparator(String fileName) voidstatic File[]static StringstripExtension(String fileName) static StringstripParentheticalSuffix(String fileName) static PropertiestoProperties(FileInputStream fileInputStream) static PropertiestoProperties(String fileName) static voidstatic voidstatic voidstatic voidstatic voidstatic voidstatic voidstatic voidwrite(File file, InputStream inputStream) static voidstatic voidstatic voidstatic voidstatic voidwrite(String fileName, InputStream inputStream) static voidstatic voidstatic voidstatic voidstatic voidstatic 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
-