Liferay 6.0.5

com.liferay.portal.util
Class FileImpl

java.lang.Object
  extended by com.liferay.portal.util.FileImpl
All Implemented Interfaces:
File

public class FileImpl
extends Object
implements File


Constructor Summary
FileImpl()
           
 
Method Summary
 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(String extension)
           
 String createTempFileName()
           
 String createTempFileName(String extension)
           
 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 getAbsolutePath(File file)
           
 byte[] getBytes(File file)
           
 byte[] getBytes(InputStream is)
           
 byte[] getBytes(InputStream inputStream, int bufferSize)
           
 String getExtension(String fileName)
           
static FileImpl getInstance()
           
 String getPath(String fullFileName)
           
 String getShortFileName(String fullFileName)
           
 boolean isAscii(File file)
           
 String[] listDirs(File file)
           
 String[] listDirs(String fileName)
           
 String[] listFiles(File file)
           
 String[] listFiles(String fileName)
           
 void mkdirs(String pathName)
           
 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)
           
 List<String> toList(Reader reader)
           
 List<String> toList(String fileName)
           
 Properties toProperties(FileInputStream fis)
           
 Properties toProperties(String fileName)
           
 void write(File file, byte[] bytes)
           
 void write(File file, byte[] bytes, int offset, int length)
           
 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)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

FileImpl

public FileImpl()
Method Detail

getInstance

public static FileImpl getInstance()

copyDirectory

public void copyDirectory(String sourceDirName,
                          String destinationDirName)
Specified by:
copyDirectory in interface File

copyDirectory

public void copyDirectory(File source,
                          File destination)
Specified by:
copyDirectory in interface File

copyFile

public void copyFile(String source,
                     String destination)
Specified by:
copyFile in interface File

copyFile

public void copyFile(String source,
                     String destination,
                     boolean lazy)
Specified by:
copyFile in interface File

copyFile

public void copyFile(File source,
                     File destination)
Specified by:
copyFile in interface File

copyFile

public void copyFile(File source,
                     File destination,
                     boolean lazy)
Specified by:
copyFile in interface File

createTempFile

public File createTempFile()
Specified by:
createTempFile in interface File

createTempFile

public File createTempFile(String extension)
Specified by:
createTempFile in interface File

createTempFileName

public String createTempFileName()
Specified by:
createTempFileName in interface File

createTempFileName

public String createTempFileName(String extension)
Specified by:
createTempFileName in interface File

decodeSafeFileName

public String decodeSafeFileName(String fileName)
Specified by:
decodeSafeFileName in interface File

delete

public boolean delete(String file)
Specified by:
delete in interface File

delete

public boolean delete(File file)
Specified by:
delete in interface File

deltree

public void deltree(String directory)
Specified by:
deltree in interface File

deltree

public void deltree(File directory)
Specified by:
deltree in interface File

encodeSafeFileName

public String encodeSafeFileName(String fileName)
Specified by:
encodeSafeFileName in interface File

exists

public boolean exists(String fileName)
Specified by:
exists in interface File

exists

public boolean exists(File file)
Specified by:
exists in interface File

extractText

public String extractText(InputStream is,
                          String fileName)
Specified by:
extractText in interface File

getAbsolutePath

public String getAbsolutePath(File file)
Specified by:
getAbsolutePath in interface File

getBytes

public byte[] getBytes(File file)
                throws IOException
Specified by:
getBytes in interface File
Throws:
IOException

getBytes

public byte[] getBytes(InputStream is)
                throws IOException
Specified by:
getBytes in interface File
Throws:
IOException

getBytes

public byte[] getBytes(InputStream inputStream,
                       int bufferSize)
                throws IOException
Specified by:
getBytes in interface File
Throws:
IOException

getExtension

public String getExtension(String fileName)
Specified by:
getExtension in interface File

getPath

public String getPath(String fullFileName)
Specified by:
getPath in interface File

getShortFileName

public String getShortFileName(String fullFileName)
Specified by:
getShortFileName in interface File

isAscii

public boolean isAscii(File file)
                throws IOException
Specified by:
isAscii in interface File
Throws:
IOException

listDirs

public String[] listDirs(String fileName)
Specified by:
listDirs in interface File

listDirs

public String[] listDirs(File file)
Specified by:
listDirs in interface File

listFiles

public String[] listFiles(String fileName)
Specified by:
listFiles in interface File

listFiles

public String[] listFiles(File file)
Specified by:
listFiles in interface File

mkdirs

public void mkdirs(String pathName)
Specified by:
mkdirs in interface File

move

public boolean move(String sourceFileName,
                    String destinationFileName)
Specified by:
move in interface File

move

public boolean move(File source,
                    File destination)
Specified by:
move in interface File

read

public String read(String fileName)
            throws IOException
Specified by:
read in interface File
Throws:
IOException

read

public String read(File file)
            throws IOException
Specified by:
read in interface File
Throws:
IOException

read

public String read(File file,
                   boolean raw)
            throws IOException
Specified by:
read in interface File
Throws:
IOException

replaceSeparator

public String replaceSeparator(String fileName)
Specified by:
replaceSeparator in interface File

sortFiles

public File[] sortFiles(File[] files)
Specified by:
sortFiles in interface File

stripExtension

public String stripExtension(String fileName)
Specified by:
stripExtension in interface File

toList

public List<String> toList(Reader reader)
Specified by:
toList in interface File

toList

public List<String> toList(String fileName)
Specified by:
toList in interface File

toProperties

public Properties toProperties(FileInputStream fis)
Specified by:
toProperties in interface File

toProperties

public Properties toProperties(String fileName)
Specified by:
toProperties in interface File

write

public void write(String fileName,
                  String s)
           throws IOException
Specified by:
write in interface File
Throws:
IOException

write

public void write(String fileName,
                  String s,
                  boolean lazy)
           throws IOException
Specified by:
write in interface File
Throws:
IOException

write

public void write(String fileName,
                  String s,
                  boolean lazy,
                  boolean append)
           throws IOException
Specified by:
write in interface File
Throws:
IOException

write

public void write(String pathName,
                  String fileName,
                  String s)
           throws IOException
Specified by:
write in interface File
Throws:
IOException

write

public void write(String pathName,
                  String fileName,
                  String s,
                  boolean lazy)
           throws IOException
Specified by:
write in interface File
Throws:
IOException

write

public void write(String pathName,
                  String fileName,
                  String s,
                  boolean lazy,
                  boolean append)
           throws IOException
Specified by:
write in interface File
Throws:
IOException

write

public void write(File file,
                  String s)
           throws IOException
Specified by:
write in interface File
Throws:
IOException

write

public void write(File file,
                  String s,
                  boolean lazy)
           throws IOException
Specified by:
write in interface File
Throws:
IOException

write

public void write(File file,
                  String s,
                  boolean lazy,
                  boolean append)
           throws IOException
Specified by:
write in interface File
Throws:
IOException

write

public void write(String fileName,
                  byte[] bytes)
           throws IOException
Specified by:
write in interface File
Throws:
IOException

write

public void write(File file,
                  byte[] bytes)
           throws IOException
Specified by:
write in interface File
Throws:
IOException

write

public void write(File file,
                  byte[] bytes,
                  int offset,
                  int length)
           throws IOException
Specified by:
write in interface File
Throws:
IOException

write

public void write(String fileName,
                  InputStream is)
           throws IOException
Specified by:
write in interface File
Throws:
IOException

write

public void write(File file,
                  InputStream is)
           throws IOException
Specified by:
write in interface File
Throws:
IOException

Liferay 6.0.5