|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
public interface SimpleFileAccessor
Simple file accessor interface.
It's too much of a bother to treat file resources in Java.
This module offers simple interface to treat file resources.
It is able to access os file system resource(using string file path value) or
access ClassPathResource object.
| Method Summary | |
|---|---|
String |
basename(File file)
Get basename from path simply. |
String |
basename(String path)
Get basename from path simply. |
void |
copy(ClassPathResource src,
ClassPathResource dest)
Copy file simply. |
void |
copy(File srcFile,
String dest)
Copy file simply. |
void |
copy(String src,
String dest)
Copy file simply. |
void |
delete(ClassPathResource resourcePath)
Delete file simply. |
void |
delete(File targetFile)
Delete file simply. |
void |
delete(String path)
Delete file simply. |
void |
deleteIfExists(ClassPathResource resourcePath)
Delete file simply if target file exists. |
void |
deleteIfExists(File targetFile)
Delete file simply if target file exists. |
void |
deleteIfExists(String path)
Delete file simply if target file exists. |
String |
dirname(File file)
Get dirname from path simply. |
String |
dirname(String path)
Get dirname from path simply. |
boolean |
fileExist(ClassPathResource resourcePath)
Check file exist. |
boolean |
fileExist(File file)
Check file exist. |
boolean |
fileExist(String path)
Check file exist. |
void |
move(ClassPathResource from,
ClassPathResource to)
Move file simply. |
void |
move(File targetFile,
String toPath)
Move file simply. |
void |
move(String fromPath,
String toPath)
Move file simply. |
void |
rename(ClassPathResource resource,
String newFilename)
Rename file simply. |
void |
rename(File file,
String newFilename)
Rename file simply. |
void |
rename(String path,
String newFilename)
Rename file simply. |
void |
touch(ClassPathResource resourcePath)
Touch file simply. |
void |
touch(File file)
Touch file simply. |
void |
touch(String path)
Touch file simply. |
| Method Detail |
|---|
String dirname(String path)
path - target file path
String dirname(File file)
file - target file object
String basename(String path)
path - target path
String basename(File file)
file - target file object
void copy(String src,
String dest)
throws IOException
src - src file pathdest - dest file path
IOException - cannot copy file
void copy(ClassPathResource src,
ClassPathResource dest)
throws IOException
src - ClassPathResource objectdest - ClassPathResource object
IOException - cannot access resources
void copy(File srcFile,
String dest)
throws IOException
srcFile - src filedest - dest file path
IOException - cannot copy file
void delete(String path)
throws IOException
path - target file path
IOException - cannot delete file
void delete(ClassPathResource resourcePath)
throws IOException
resourcePath - ClassPathResource object
IOException - cannot access resources
void delete(File targetFile)
throws IOException
targetFile - target file object
IOException - cannot delete file
void deleteIfExists(String path)
throws IOException
path - target file path
IOException - cannot delete file
void deleteIfExists(ClassPathResource resourcePath)
throws IOException
resourcePath - ClassPathResource object
IOException - cannot access resources
void deleteIfExists(File targetFile)
throws IOException
targetFile - target file object
IOException - cannot delete file
void move(String fromPath,
String toPath)
throws IOException
fromPath - from file pathtoPath - to file path
IOException - cannot move file
void move(ClassPathResource from,
ClassPathResource to)
throws IOException
from - ClassPathResource from resourceto - ClassPathResource to resource
IOException - cannot access resources
void move(File targetFile,
String toPath)
throws IOException
targetFile - from file objecttoPath - to file path
IOException - cannot move file
void rename(String path,
String newFilename)
throws IOException
path - target file pathnewFilename - new file name
IOException - cannot rename file
void rename(ClassPathResource resource,
String newFilename)
throws IOException
resource - ClassPathResource resourcenewFilename - new file name
IOException - cannot access resources
void rename(File file,
String newFilename)
throws IOException
file - target file objectnewFilename - new file name
IOException - cannot rename file
void touch(String path)
throws IOException
path - target file path
IOException - cannot touch file
void touch(ClassPathResource resourcePath)
throws IOException
resourcePath - ClassPathResource resource
IOException - cannot access resources
void touch(File file)
throws IOException
file - target file object
IOException - cannot touch fileboolean fileExist(String path)
path - target file path
boolean fileExist(ClassPathResource resourcePath)
resourcePath - ClassPathResource resource
boolean fileExist(File file)
file - target file object
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||