public class FileImpl
extends Object
implements com.liferay.portal.kernel.util.File
| Constructor and Description |
|---|
FileImpl() |
| Modifier and Type | Method and Description |
|---|---|
String |
appendParentheticalSuffix(String fileName,
String suffix) |
String |
appendSuffix(String fileName,
String suffix) |
void |
copyDirectory(File source,
File destination) |
void |
copyDirectory(String sourceDirName,
String destinationDirName) |
void |
copyFile(File source,
File destination) |
void |
copyFile(File source,
File destination,
boolean lazy) |
void |
copyFile(String source,
String destination) |
void |
copyFile(String source,
String destination,
boolean lazy) |
File |
createTempFile() |
File |
createTempFile(byte[] bytes) |
File |
createTempFile(InputStream inputStream) |
File |
createTempFile(String extension) |
File |
createTempFile(String prefix,
String extension) |
String |
createTempFileName() |
String |
createTempFileName(String extension) |
String |
createTempFileName(String prefix,
String extension) |
File |
createTempFolder() |
String |
decodeSafeFileName(String fileName) |
boolean |
delete(File file) |
boolean |
delete(String file) |
void |
deltree(File directory) |
void |
deltree(String directory) |
String |
encodeSafeFileName(String fileName) |
boolean |
exists(File file) |
boolean |
exists(String fileName) |
String |
extractText(InputStream inputStream) |
String |
extractText(InputStream inputStream,
int maxStringLength) |
String |
getAbsolutePath(File file) |
byte[] |
getBytes(Class<?> clazz,
String fileName) |
byte[] |
getBytes(File file) |
byte[] |
getBytes(InputStream inputStream) |
byte[] |
getBytes(InputStream inputStream,
int bufferSize) |
byte[] |
getBytes(InputStream inputStream,
int bufferSize,
boolean cleanUpStream) |
String |
getExtension(String fileName) |
static FileImpl |
getInstance() |
String |
getMD5Checksum(File file) |
String |
getPath(String fullFileName) |
String |
getShortFileName(String fullFileName) |
boolean |
isSameContent(File file,
byte[] bytes,
int length) |
boolean |
isSameContent(File file,
String s) |
String[] |
listDirs(File file) |
String[] |
listDirs(String fileName) |
String[] |
listFiles(File file) |
String[] |
listFiles(String fileName) |
void |
mkdirs(File file) |
void |
mkdirs(String pathName) |
protected void |
mkdirsParentFile(File file) |
boolean |
move(File source,
File destination) |
boolean |
move(String sourceFileName,
String destinationFileName) |
String |
read(File file) |
String |
read(File file,
boolean raw) |
String |
read(String fileName) |
String |
replaceSeparator(String fileName) |
File[] |
sortFiles(File[] files) |
String |
stripExtension(String fileName) |
String |
stripParentheticalSuffix(String fileName) |
List<String> |
toList(Reader reader) |
List<String> |
toList(String fileName) |
Properties |
toProperties(FileInputStream fileInputStream) |
Properties |
toProperties(String fileName) |
void |
touch(File file) |
void |
touch(String fileName) |
void |
unzip(File source,
File destination) |
void |
write(File file,
byte[] bytes) |
void |
write(File file,
byte[] bytes,
boolean append) |
void |
write(File file,
byte[] bytes,
int offset,
int length) |
void |
write(File file,
byte[] bytes,
int offset,
int length,
boolean append) |
void |
write(File file,
InputStream inputStream) |
void |
write(File file,
String s) |
void |
write(File file,
String s,
boolean lazy) |
void |
write(File file,
String s,
boolean lazy,
boolean append) |
void |
write(String fileName,
byte[] bytes) |
void |
write(String fileName,
InputStream inputStream) |
void |
write(String fileName,
String s) |
void |
write(String fileName,
String s,
boolean lazy) |
void |
write(String fileName,
String s,
boolean lazy,
boolean append) |
void |
write(String pathName,
String fileName,
String s) |
void |
write(String pathName,
String fileName,
String s,
boolean lazy) |
void |
write(String pathName,
String fileName,
String s,
boolean lazy,
boolean append) |
public static FileImpl getInstance()
public String appendParentheticalSuffix(String fileName,
String suffix)
appendParentheticalSuffix in interface com.liferay.portal.kernel.util.Filepublic String appendSuffix(String fileName,
String suffix)
appendSuffix in interface com.liferay.portal.kernel.util.Filepublic void copyDirectory(File source,
File destination)
throws IOException
copyDirectory in interface com.liferay.portal.kernel.util.FileIOExceptionpublic void copyDirectory(String sourceDirName,
String destinationDirName)
throws IOException
copyDirectory in interface com.liferay.portal.kernel.util.FileIOExceptionpublic void copyFile(File source,
File destination)
throws IOException
copyFile in interface com.liferay.portal.kernel.util.FileIOExceptionpublic void copyFile(File source,
File destination,
boolean lazy)
throws IOException
copyFile in interface com.liferay.portal.kernel.util.FileIOExceptionpublic void copyFile(String source,
String destination)
throws IOException
copyFile in interface com.liferay.portal.kernel.util.FileIOExceptionpublic void copyFile(String source,
String destination,
boolean lazy)
throws IOException
copyFile in interface com.liferay.portal.kernel.util.FileIOExceptionpublic File createTempFile()
createTempFile in interface com.liferay.portal.kernel.util.Filepublic File createTempFile(byte[] bytes)
throws IOException
createTempFile in interface com.liferay.portal.kernel.util.FileIOExceptionpublic File createTempFile(InputStream inputStream)
throws IOException
createTempFile in interface com.liferay.portal.kernel.util.FileIOExceptionpublic File createTempFile(String extension)
createTempFile in interface com.liferay.portal.kernel.util.Filepublic File createTempFile(String prefix,
String extension)
createTempFile in interface com.liferay.portal.kernel.util.Filepublic String createTempFileName()
createTempFileName in interface com.liferay.portal.kernel.util.Filepublic String createTempFileName(String extension)
createTempFileName in interface com.liferay.portal.kernel.util.Filepublic String createTempFileName(String prefix,
String extension)
createTempFileName in interface com.liferay.portal.kernel.util.Filepublic File createTempFolder()
throws IOException
createTempFolder in interface com.liferay.portal.kernel.util.FileIOExceptionpublic String decodeSafeFileName(String fileName)
decodeSafeFileName in interface com.liferay.portal.kernel.util.Filepublic boolean delete(File file)
delete in interface com.liferay.portal.kernel.util.Filepublic boolean delete(String file)
delete in interface com.liferay.portal.kernel.util.Filepublic void deltree(File directory)
deltree in interface com.liferay.portal.kernel.util.Filepublic void deltree(String directory)
deltree in interface com.liferay.portal.kernel.util.Filepublic String encodeSafeFileName(String fileName)
encodeSafeFileName in interface com.liferay.portal.kernel.util.Filepublic boolean exists(File file)
exists in interface com.liferay.portal.kernel.util.Filepublic boolean exists(String fileName)
exists in interface com.liferay.portal.kernel.util.Filepublic String extractText(InputStream inputStream)
extractText in interface com.liferay.portal.kernel.util.Filepublic String extractText(InputStream inputStream,
int maxStringLength)
extractText in interface com.liferay.portal.kernel.util.Filepublic String getAbsolutePath(File file)
getAbsolutePath in interface com.liferay.portal.kernel.util.Filepublic byte[] getBytes(Class<?> clazz,
String fileName)
throws IOException
getBytes in interface com.liferay.portal.kernel.util.FileIOExceptionpublic byte[] getBytes(File file)
throws IOException
getBytes in interface com.liferay.portal.kernel.util.FileIOExceptionpublic byte[] getBytes(InputStream inputStream)
throws IOException
getBytes in interface com.liferay.portal.kernel.util.FileIOExceptionpublic byte[] getBytes(InputStream inputStream,
int bufferSize)
throws IOException
getBytes in interface com.liferay.portal.kernel.util.FileIOExceptionpublic byte[] getBytes(InputStream inputStream,
int bufferSize,
boolean cleanUpStream)
throws IOException
getBytes in interface com.liferay.portal.kernel.util.FileIOExceptionpublic String getExtension(String fileName)
getExtension in interface com.liferay.portal.kernel.util.Filepublic String getMD5Checksum(File file)
throws IOException
getMD5Checksum in interface com.liferay.portal.kernel.util.FileIOExceptionpublic String getPath(String fullFileName)
getPath in interface com.liferay.portal.kernel.util.Filepublic String getShortFileName(String fullFileName)
getShortFileName in interface com.liferay.portal.kernel.util.Filepublic boolean isSameContent(File file,
byte[] bytes,
int length)
isSameContent in interface com.liferay.portal.kernel.util.Filepublic boolean isSameContent(File file,
String s)
isSameContent in interface com.liferay.portal.kernel.util.Filepublic String[] listDirs(File file)
listDirs in interface com.liferay.portal.kernel.util.Filepublic String[] listDirs(String fileName)
listDirs in interface com.liferay.portal.kernel.util.Filepublic String[] listFiles(File file)
listFiles in interface com.liferay.portal.kernel.util.Filepublic String[] listFiles(String fileName)
listFiles in interface com.liferay.portal.kernel.util.Filepublic void mkdirs(File file)
throws IOException
mkdirs in interface com.liferay.portal.kernel.util.FileIOExceptionpublic void mkdirs(String pathName)
mkdirs in interface com.liferay.portal.kernel.util.Filepublic boolean move(File source,
File destination)
move in interface com.liferay.portal.kernel.util.Filepublic boolean move(String sourceFileName,
String destinationFileName)
move in interface com.liferay.portal.kernel.util.Filepublic String read(File file)
throws IOException
read in interface com.liferay.portal.kernel.util.FileIOExceptionpublic String read(File file,
boolean raw)
throws IOException
read in interface com.liferay.portal.kernel.util.FileIOExceptionpublic String read(String fileName)
throws IOException
read in interface com.liferay.portal.kernel.util.FileIOExceptionpublic String replaceSeparator(String fileName)
replaceSeparator in interface com.liferay.portal.kernel.util.Filepublic File[] sortFiles(File[] files)
sortFiles in interface com.liferay.portal.kernel.util.Filepublic String stripExtension(String fileName)
stripExtension in interface com.liferay.portal.kernel.util.Filepublic String stripParentheticalSuffix(String fileName)
stripParentheticalSuffix in interface com.liferay.portal.kernel.util.Filepublic List<String> toList(Reader reader)
toList in interface com.liferay.portal.kernel.util.Filepublic List<String> toList(String fileName)
toList in interface com.liferay.portal.kernel.util.Filepublic Properties toProperties(FileInputStream fileInputStream)
toProperties in interface com.liferay.portal.kernel.util.Filepublic Properties toProperties(String fileName)
toProperties in interface com.liferay.portal.kernel.util.Filepublic void touch(File file)
throws IOException
touch in interface com.liferay.portal.kernel.util.FileIOExceptionpublic void touch(String fileName)
throws IOException
touch in interface com.liferay.portal.kernel.util.FileIOExceptionpublic void unzip(File source,
File destination)
unzip in interface com.liferay.portal.kernel.util.Filepublic void write(File file,
byte[] bytes)
throws IOException
write in interface com.liferay.portal.kernel.util.FileIOExceptionpublic void write(File file,
byte[] bytes,
boolean append)
throws IOException
write in interface com.liferay.portal.kernel.util.FileIOExceptionpublic void write(File file,
byte[] bytes,
int offset,
int length)
throws IOException
write in interface com.liferay.portal.kernel.util.FileIOExceptionpublic void write(File file,
byte[] bytes,
int offset,
int length,
boolean append)
throws IOException
write in interface com.liferay.portal.kernel.util.FileIOExceptionpublic void write(File file,
InputStream inputStream)
throws IOException
write in interface com.liferay.portal.kernel.util.FileIOExceptionpublic void write(File file,
String s)
throws IOException
write in interface com.liferay.portal.kernel.util.FileIOExceptionpublic void write(File file,
String s,
boolean lazy)
throws IOException
write in interface com.liferay.portal.kernel.util.FileIOExceptionpublic void write(File file,
String s,
boolean lazy,
boolean append)
throws IOException
write in interface com.liferay.portal.kernel.util.FileIOExceptionpublic void write(String fileName,
byte[] bytes)
throws IOException
write in interface com.liferay.portal.kernel.util.FileIOExceptionpublic void write(String fileName,
InputStream inputStream)
throws IOException
write in interface com.liferay.portal.kernel.util.FileIOExceptionpublic void write(String fileName,
String s)
throws IOException
write in interface com.liferay.portal.kernel.util.FileIOExceptionpublic void write(String fileName,
String s,
boolean lazy)
throws IOException
write in interface com.liferay.portal.kernel.util.FileIOExceptionpublic void write(String fileName,
String s,
boolean lazy,
boolean append)
throws IOException
write in interface com.liferay.portal.kernel.util.FileIOExceptionpublic void write(String pathName,
String fileName,
String s)
throws IOException
write in interface com.liferay.portal.kernel.util.FileIOExceptionpublic void write(String pathName,
String fileName,
String s,
boolean lazy)
throws IOException
write in interface com.liferay.portal.kernel.util.FileIOExceptionpublic void write(String pathName,
String fileName,
String s,
boolean lazy,
boolean append)
throws IOException
write in interface com.liferay.portal.kernel.util.FileIOExceptionprotected void mkdirsParentFile(File file)
throws IOException
IOException