jp.sourceforge.simplefh.impl
Class SimpleFileAccessorImpl

java.lang.Object
  extended by jp.sourceforge.simplefh.impl.SimpleFileAccessorImpl
All Implemented Interfaces:
SimpleFileAccessor

public class SimpleFileAccessorImpl
extends Object
implements SimpleFileAccessor

Version:
1.0
Author:
Kazuhiro Sera
See Also:
SimpleFileAccessor

Constructor Summary
SimpleFileAccessorImpl()
           
 
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 filepath)
          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.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SimpleFileAccessorImpl

public SimpleFileAccessorImpl()
Method Detail

dirname

public String dirname(String path)
Description copied from interface: SimpleFileAccessor
Get dirname from path simply.

It is compatible with UNIX command.

Specified by:
dirname in interface SimpleFileAccessor
Parameters:
path - target file path
Returns:
dirname string
See Also:
SimpleFileAccessor.dirname(java.lang.String)

dirname

public String dirname(File file)
Description copied from interface: SimpleFileAccessor
Get dirname from path simply.

It is compatible with UNIX command.

Specified by:
dirname in interface SimpleFileAccessor
Parameters:
file - target file object
Returns:
dirname string
See Also:
SimpleFileAccessor.dirname(java.io.File)

basename

public String basename(String path)
Description copied from interface: SimpleFileAccessor
Get basename from path simply.

It is compatible with UNIX command.

Specified by:
basename in interface SimpleFileAccessor
Parameters:
path - target path
Returns:
basename string
See Also:
SimpleFileAccessor.basename(java.lang.String)

basename

public String basename(File file)
Description copied from interface: SimpleFileAccessor
Get basename from path simply.

It is compatible with UNIX command.

Specified by:
basename in interface SimpleFileAccessor
Parameters:
file - target file object
Returns:
basename string
See Also:
SimpleFileAccessor.basename(java.io.File)

copy

public void copy(String src,
                 String dest)
          throws IOException
Description copied from interface: SimpleFileAccessor
Copy file simply.

Specified by:
copy in interface SimpleFileAccessor
Parameters:
src - src file path
dest - dest file path
Throws:
IOException - cannot copy file
ex. source file does not exist
See Also:
jp.sourceforge.simplefh.SimpleFileAccessor#copy(java.lang.String, java.io.String)

copy

public void copy(File srcFile,
                 String dest)
          throws IOException
Description copied from interface: SimpleFileAccessor
Copy file simply.

Specified by:
copy in interface SimpleFileAccessor
Parameters:
srcFile - src file
dest - dest file path
Throws:
IOException - cannot copy file
ex. source file does not exist
See Also:
SimpleFileAccessor.copy(java.io.File, java.lang.String)

copy

public void copy(ClassPathResource src,
                 ClassPathResource dest)
          throws IOException
Description copied from interface: SimpleFileAccessor
Copy file simply.

If destination file was in archive path,
it's impossible to copy it and this method throws IOException.

Specified by:
copy in interface SimpleFileAccessor
Parameters:
src - ClassPathResource object
dest - ClassPathResource object
Throws:
IOException - cannot access resources
See Also:
jp.sourceforge.simplefh.SimpleFileAccessor#copy(jp.sourceforge.simplefh .ClassPathResource, jp.sourceforge.simplefh.ClassPathResource)

delete

public void delete(String filepath)
            throws IOException
Description copied from interface: SimpleFileAccessor
Delete file simply.

Specified by:
delete in interface SimpleFileAccessor
Parameters:
filepath - target file path
Throws:
IOException - cannot delete file
ex. file does not exist, locked
See Also:
SimpleFileAccessor.delete(java.lang.String)

delete

public void delete(ClassPathResource resourcePath)
            throws IOException
Description copied from interface: SimpleFileAccessor
Delete file simply.

If target file was in archive path,
it's impossible to delete it and this method throws IOException.

Specified by:
delete in interface SimpleFileAccessor
Parameters:
resourcePath - ClassPathResource object
Throws:
IOException - cannot access resources
See Also:
jp.sourceforge.simplefh.SimpleFileAccessor#delete(jp.sourceforge.simplefh .ClassPathResource)

delete

public void delete(File targetFile)
            throws IOException
Description copied from interface: SimpleFileAccessor
Delete file simply.

Specified by:
delete in interface SimpleFileAccessor
Parameters:
targetFile - target file object
Throws:
IOException - cannot delete file
ex. file does not exist, locked
See Also:
SimpleFileAccessor.delete(java.io.File)

deleteIfExists

public void deleteIfExists(String path)
                    throws IOException
Description copied from interface: SimpleFileAccessor
Delete file simply if target file exists.

Specified by:
deleteIfExists in interface SimpleFileAccessor
Parameters:
path - target file path
Throws:
IOException - cannot delete file
ex. file does not exist, locked
See Also:
SimpleFileAccessor.deleteIfExists(java.lang.String)

deleteIfExists

public void deleteIfExists(ClassPathResource resourcePath)
                    throws IOException
Description copied from interface: SimpleFileAccessor
Delete file simply if target file exists.

If target file was in archive path,
it's impossible to delete it and this method throws IOException.

Specified by:
deleteIfExists in interface SimpleFileAccessor
Parameters:
resourcePath - ClassPathResource object
Throws:
IOException - cannot access resources
See Also:
SimpleFileAccessor.deleteIfExists(jp.sourceforge.simplefh.ClassPathResource)

deleteIfExists

public void deleteIfExists(File targetFile)
                    throws IOException
Description copied from interface: SimpleFileAccessor
Delete file simply if target file exists.

Specified by:
deleteIfExists in interface SimpleFileAccessor
Parameters:
targetFile - target file object
Throws:
IOException - cannot delete file
ex. file does not exist, locked
See Also:
SimpleFileAccessor.deleteIfExists(java.io.File)

move

public void move(String fromPath,
                 String toPath)
          throws IOException
Description copied from interface: SimpleFileAccessor
Move file simply.

Specified by:
move in interface SimpleFileAccessor
Parameters:
fromPath - from file path
toPath - to file path
Throws:
IOException - cannot move file
ex. from file not found, locked
See Also:
SimpleFileAccessor.move(java.lang.String, java.lang.String)

move

public void move(ClassPathResource from,
                 ClassPathResource to)
          throws IOException
Description copied from interface: SimpleFileAccessor
Move file simply.

If target file or destination file was in archive path,
it's impossible to move it and this method throws IOException.

Specified by:
move in interface SimpleFileAccessor
Parameters:
from - ClassPathResource from resource
to - ClassPathResource to resource
Throws:
IOException - cannot access resources
See Also:
jp.sourceforge.simplefh.SimpleFileAccessor#move(jp.sourceforge.simplefh .ClassPathResource, jp.sourceforge.simplefh.ClassPathResource)

move

public void move(File targetFile,
                 String toPath)
          throws IOException
Description copied from interface: SimpleFileAccessor
Move file simply.

Specified by:
move in interface SimpleFileAccessor
Parameters:
targetFile - from file object
toPath - to file path
Throws:
IOException - cannot move file
ex. from file not found, locked
See Also:
SimpleFileAccessor.move(java.io.File, java.lang.String)

rename

public void rename(String path,
                   String newFilename)
            throws IOException
Description copied from interface: SimpleFileAccessor
Rename file simply.

Specified by:
rename in interface SimpleFileAccessor
Parameters:
path - target file path
newFilename - new file name
Throws:
IOException - cannot rename file
ex. from file not found, locked
See Also:
SimpleFileAccessor.rename(java.lang.String, java.lang.String)

rename

public void rename(ClassPathResource resource,
                   String newFilename)
            throws IOException
Description copied from interface: SimpleFileAccessor
Rename file simply.

If target file or destination file was in archive path,
it's impossible to rename it and this method throws IOException.

Specified by:
rename in interface SimpleFileAccessor
Parameters:
resource - ClassPathResource resource
newFilename - new file name
Throws:
IOException - cannot access resources
See Also:
jp.sourceforge.simplefh.SimpleFileAccessor#rename(jp.sourceforge.simplefh .ClassPathResource, java.lang.String)

rename

public void rename(File file,
                   String newFilename)
            throws IOException
Description copied from interface: SimpleFileAccessor
Rename file simply.

Specified by:
rename in interface SimpleFileAccessor
Parameters:
file - target file object
newFilename - new file name
Throws:
IOException - cannot rename file
ex. from file not found, locked
See Also:
SimpleFileAccessor.rename(java.io.File, java.lang.String)

touch

public void touch(String path)
           throws IOException
Description copied from interface: SimpleFileAccessor
Touch file simply.

Specified by:
touch in interface SimpleFileAccessor
Parameters:
path - target file path
Throws:
IOException - cannot touch file
See Also:
SimpleFileAccessor.touch(java.lang.String)

touch

public void touch(ClassPathResource resourcePath)
           throws IOException
Description copied from interface: SimpleFileAccessor
Touch file simply.

If target file was in archive path,
it's impossible to touch it and this method throws IOException.

Specified by:
touch in interface SimpleFileAccessor
Parameters:
resourcePath - ClassPathResource resource
Throws:
IOException - cannot access resources
See Also:
jp.sourceforge.simplefh.SimpleFileAccessor#touch(jp.sourceforge.simplefh .ClassPathResource)

touch

public void touch(File file)
           throws IOException
Description copied from interface: SimpleFileAccessor
Touch file simply.

Specified by:
touch in interface SimpleFileAccessor
Parameters:
file - target file object
Throws:
IOException - cannot touch file
See Also:
SimpleFileAccessor.touch(java.io.File)

fileExist

public boolean fileExist(String path)
Description copied from interface: SimpleFileAccessor
Check file exist.

Specified by:
fileExist in interface SimpleFileAccessor
Parameters:
path - target file path
Returns:
result boolean value
See Also:
SimpleFileAccessor.fileExist(java.lang.String)

fileExist

public boolean fileExist(File file)
Description copied from interface: SimpleFileAccessor
Check file exist.

Specified by:
fileExist in interface SimpleFileAccessor
Parameters:
file - target file object
Returns:
result boolean value
See Also:
SimpleFileAccessor.fileExist(java.io.File)

fileExist

public boolean fileExist(ClassPathResource resourcePath)
Description copied from interface: SimpleFileAccessor
Check file exist.

Specified by:
fileExist in interface SimpleFileAccessor
Parameters:
resourcePath - ClassPathResource resource
Returns:
result boolean value
See Also:
jp.sourceforge.simplefh.SimpleFileAccessor#fileExist(jp.sourceforge.simplefh .ClassPathResource)