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 is) |
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 is,
String fileName) |
String |
extractText(InputStream is,
String fileName,
int maxStringLength) |
String[] |
find(String directory,
String includes,
String excludes) |
String |
getAbsolutePath(File file) |
byte[] |
getBytes(Class<?> clazz,
String fileName) |
byte[] |
getBytes(File file) |
byte[] |
getBytes(InputStream is) |
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 |
isAscii(File file) |
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 fis) |
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 is) |
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 is) |
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.File
public String appendSuffix(String fileName, String suffix)
appendSuffix
in interface com.liferay.portal.kernel.util.File
public void copyDirectory(File source, File destination) throws IOException
copyDirectory
in interface com.liferay.portal.kernel.util.File
IOException
public void copyDirectory(String sourceDirName, String destinationDirName) throws IOException
copyDirectory
in interface com.liferay.portal.kernel.util.File
IOException
public void copyFile(File source, File destination) throws IOException
copyFile
in interface com.liferay.portal.kernel.util.File
IOException
public void copyFile(File source, File destination, boolean lazy) throws IOException
copyFile
in interface com.liferay.portal.kernel.util.File
IOException
public void copyFile(String source, String destination) throws IOException
copyFile
in interface com.liferay.portal.kernel.util.File
IOException
public void copyFile(String source, String destination, boolean lazy) throws IOException
copyFile
in interface com.liferay.portal.kernel.util.File
IOException
public File createTempFile()
createTempFile
in interface com.liferay.portal.kernel.util.File
public File createTempFile(byte[] bytes) throws IOException
createTempFile
in interface com.liferay.portal.kernel.util.File
IOException
public File createTempFile(InputStream is) throws IOException
createTempFile
in interface com.liferay.portal.kernel.util.File
IOException
public File createTempFile(String extension)
createTempFile
in interface com.liferay.portal.kernel.util.File
public File createTempFile(String prefix, String extension)
createTempFile
in interface com.liferay.portal.kernel.util.File
public String createTempFileName()
createTempFileName
in interface com.liferay.portal.kernel.util.File
public String createTempFileName(String extension)
createTempFileName
in interface com.liferay.portal.kernel.util.File
public String createTempFileName(String prefix, String extension)
createTempFileName
in interface com.liferay.portal.kernel.util.File
public File createTempFolder() throws IOException
createTempFolder
in interface com.liferay.portal.kernel.util.File
IOException
public String decodeSafeFileName(String fileName)
decodeSafeFileName
in interface com.liferay.portal.kernel.util.File
public boolean delete(File file)
delete
in interface com.liferay.portal.kernel.util.File
public boolean delete(String file)
delete
in interface com.liferay.portal.kernel.util.File
public void deltree(File directory)
deltree
in interface com.liferay.portal.kernel.util.File
public void deltree(String directory)
deltree
in interface com.liferay.portal.kernel.util.File
public String encodeSafeFileName(String fileName)
encodeSafeFileName
in interface com.liferay.portal.kernel.util.File
public boolean exists(File file)
exists
in interface com.liferay.portal.kernel.util.File
public boolean exists(String fileName)
exists
in interface com.liferay.portal.kernel.util.File
public String extractText(InputStream is, String fileName)
extractText
in interface com.liferay.portal.kernel.util.File
public String extractText(InputStream is, String fileName, int maxStringLength)
extractText
in interface com.liferay.portal.kernel.util.File
public String[] find(String directory, String includes, String excludes)
find
in interface com.liferay.portal.kernel.util.File
public String getAbsolutePath(File file)
getAbsolutePath
in interface com.liferay.portal.kernel.util.File
public byte[] getBytes(Class<?> clazz, String fileName) throws IOException
getBytes
in interface com.liferay.portal.kernel.util.File
IOException
public byte[] getBytes(File file) throws IOException
getBytes
in interface com.liferay.portal.kernel.util.File
IOException
public byte[] getBytes(InputStream is) throws IOException
getBytes
in interface com.liferay.portal.kernel.util.File
IOException
public byte[] getBytes(InputStream inputStream, int bufferSize) throws IOException
getBytes
in interface com.liferay.portal.kernel.util.File
IOException
public byte[] getBytes(InputStream inputStream, int bufferSize, boolean cleanUpStream) throws IOException
getBytes
in interface com.liferay.portal.kernel.util.File
IOException
public String getExtension(String fileName)
getExtension
in interface com.liferay.portal.kernel.util.File
public String getMD5Checksum(File file) throws IOException
getMD5Checksum
in interface com.liferay.portal.kernel.util.File
IOException
public String getPath(String fullFileName)
getPath
in interface com.liferay.portal.kernel.util.File
public String getShortFileName(String fullFileName)
getShortFileName
in interface com.liferay.portal.kernel.util.File
public boolean isAscii(File file) throws IOException
isAscii
in interface com.liferay.portal.kernel.util.File
IOException
public boolean isSameContent(File file, byte[] bytes, int length)
isSameContent
in interface com.liferay.portal.kernel.util.File
public boolean isSameContent(File file, String s)
isSameContent
in interface com.liferay.portal.kernel.util.File
public String[] listDirs(File file)
listDirs
in interface com.liferay.portal.kernel.util.File
public String[] listDirs(String fileName)
listDirs
in interface com.liferay.portal.kernel.util.File
public String[] listFiles(File file)
listFiles
in interface com.liferay.portal.kernel.util.File
public String[] listFiles(String fileName)
listFiles
in interface com.liferay.portal.kernel.util.File
public void mkdirs(File file) throws IOException
mkdirs
in interface com.liferay.portal.kernel.util.File
IOException
public void mkdirs(String pathName)
mkdirs
in interface com.liferay.portal.kernel.util.File
public boolean move(File source, File destination)
move
in interface com.liferay.portal.kernel.util.File
public boolean move(String sourceFileName, String destinationFileName)
move
in interface com.liferay.portal.kernel.util.File
public String read(File file) throws IOException
read
in interface com.liferay.portal.kernel.util.File
IOException
public String read(File file, boolean raw) throws IOException
read
in interface com.liferay.portal.kernel.util.File
IOException
public String read(String fileName) throws IOException
read
in interface com.liferay.portal.kernel.util.File
IOException
public String replaceSeparator(String fileName)
replaceSeparator
in interface com.liferay.portal.kernel.util.File
public File[] sortFiles(File[] files)
sortFiles
in interface com.liferay.portal.kernel.util.File
public String stripExtension(String fileName)
stripExtension
in interface com.liferay.portal.kernel.util.File
public String stripParentheticalSuffix(String fileName)
stripParentheticalSuffix
in interface com.liferay.portal.kernel.util.File
public List<String> toList(Reader reader)
toList
in interface com.liferay.portal.kernel.util.File
public List<String> toList(String fileName)
toList
in interface com.liferay.portal.kernel.util.File
public Properties toProperties(FileInputStream fis)
toProperties
in interface com.liferay.portal.kernel.util.File
public Properties toProperties(String fileName)
toProperties
in interface com.liferay.portal.kernel.util.File
public void touch(File file) throws IOException
touch
in interface com.liferay.portal.kernel.util.File
IOException
public void touch(String fileName) throws IOException
touch
in interface com.liferay.portal.kernel.util.File
IOException
public void unzip(File source, File destination)
unzip
in interface com.liferay.portal.kernel.util.File
public void write(File file, byte[] bytes) throws IOException
write
in interface com.liferay.portal.kernel.util.File
IOException
public void write(File file, byte[] bytes, boolean append) throws IOException
write
in interface com.liferay.portal.kernel.util.File
IOException
public void write(File file, byte[] bytes, int offset, int length) throws IOException
write
in interface com.liferay.portal.kernel.util.File
IOException
public void write(File file, byte[] bytes, int offset, int length, boolean append) throws IOException
write
in interface com.liferay.portal.kernel.util.File
IOException
public void write(File file, InputStream is) throws IOException
write
in interface com.liferay.portal.kernel.util.File
IOException
public void write(File file, String s) throws IOException
write
in interface com.liferay.portal.kernel.util.File
IOException
public void write(File file, String s, boolean lazy) throws IOException
write
in interface com.liferay.portal.kernel.util.File
IOException
public void write(File file, String s, boolean lazy, boolean append) throws IOException
write
in interface com.liferay.portal.kernel.util.File
IOException
public void write(String fileName, byte[] bytes) throws IOException
write
in interface com.liferay.portal.kernel.util.File
IOException
public void write(String fileName, InputStream is) throws IOException
write
in interface com.liferay.portal.kernel.util.File
IOException
public void write(String fileName, String s) throws IOException
write
in interface com.liferay.portal.kernel.util.File
IOException
public void write(String fileName, String s, boolean lazy) throws IOException
write
in interface com.liferay.portal.kernel.util.File
IOException
public void write(String fileName, String s, boolean lazy, boolean append) throws IOException
write
in interface com.liferay.portal.kernel.util.File
IOException
public void write(String pathName, String fileName, String s) throws IOException
write
in interface com.liferay.portal.kernel.util.File
IOException
public void write(String pathName, String fileName, String s, boolean lazy) throws IOException
write
in interface com.liferay.portal.kernel.util.File
IOException
public void write(String pathName, String fileName, String s, boolean lazy, boolean append) throws IOException
write
in interface com.liferay.portal.kernel.util.File
IOException
protected void mkdirsParentFile(File file) throws IOException
IOException