|
||||||||||
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 filevoid copy(ClassPathResource src, ClassPathResource dest) throws IOException
src
- ClassPathResource
objectdest
- ClassPathResource
object
IOException
- cannot access resourcesvoid copy(File srcFile, String dest) throws IOException
srcFile
- src filedest
- dest file path
IOException
- cannot copy filevoid delete(String path) throws IOException
path
- target file path
IOException
- cannot delete filevoid delete(ClassPathResource resourcePath) throws IOException
resourcePath
- ClassPathResource
object
IOException
- cannot access resourcesvoid delete(File targetFile) throws IOException
targetFile
- target file object
IOException
- cannot delete filevoid deleteIfExists(String path) throws IOException
path
- target file path
IOException
- cannot delete filevoid deleteIfExists(ClassPathResource resourcePath) throws IOException
resourcePath
- ClassPathResource
object
IOException
- cannot access resourcesvoid deleteIfExists(File targetFile) throws IOException
targetFile
- target file object
IOException
- cannot delete filevoid move(String fromPath, String toPath) throws IOException
fromPath
- from file pathtoPath
- to file path
IOException
- cannot move filevoid move(ClassPathResource from, ClassPathResource to) throws IOException
from
- ClassPathResource
from resourceto
- ClassPathResource
to resource
IOException
- cannot access resourcesvoid move(File targetFile, String toPath) throws IOException
targetFile
- from file objecttoPath
- to file path
IOException
- cannot move filevoid rename(String path, String newFilename) throws IOException
path
- target file pathnewFilename
- new file name
IOException
- cannot rename filevoid rename(ClassPathResource resource, String newFilename) throws IOException
resource
- ClassPathResource
resourcenewFilename
- new file name
IOException
- cannot access resourcesvoid rename(File file, String newFilename) throws IOException
file
- target file objectnewFilename
- new file name
IOException
- cannot rename filevoid touch(String path) throws IOException
path
- target file path
IOException
- cannot touch filevoid touch(ClassPathResource resourcePath) throws IOException
resourcePath
- ClassPathResource
resource
IOException
- cannot access resourcesvoid 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 |