jp.sourceforge.simplefh.impl
Class SimpleFileReaderImpl

java.lang.Object
  extended by jp.sourceforge.simplefh.impl.SimpleFileReaderImpl
All Implemented Interfaces:
SimpleFileReader

public class SimpleFileReaderImpl
extends Object
implements SimpleFileReader

Version:
1.0
Author:
Kazuhiro Sera
See Also:
SimpleFileReader

Constructor Summary
SimpleFileReaderImpl()
           
 
Method Summary
 Integer getDefaultArrayLength()
          Get default array length to buffering.
 String getEncodingToRead()
          Get encoding to read.
 byte[] read2ByteArray(ClassPathResource resourcePath)
          Read resource content(convert to byte array).
 byte[] read2ByteArray(File file)
          Read file content(convert to byte array).
 byte[] read2ByteArray(String path)
          Read file content(convert to byte array).
 char[] read2CharArray(ClassPathResource resourcePath)
          Read resource content(convert to char array).
 char[] read2CharArray(File file)
          Read file content(convert to char array).
 char[] read2CharArray(String path)
          Read file content(convert to char array).
 String[] read2StringLineArray(ClassPathResource resourcePath)
          Read resource content(convert to String array).
 String[] read2StringLineArray(File file)
          Read file content(convert to String array).
 String[] read2StringLineArray(String path)
          Read file content(convert to String array).
 List<String> read2StringLineList(ClassPathResource resourcePath)
          Read resource content(convert to String List).
 List<String> read2StringLineList(File file)
          Read file content(convert to String List).
 List<String> read2StringLineList(String path)
          Read file content(convert to String List).
 SimpleFileReader setDefaultArrayLength(Integer defaultArrayLength)
          Set default array length to buffering.
 SimpleFileReader setEncodingToRead(String encodingToRead)
          Set encoding to read.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SimpleFileReaderImpl

public SimpleFileReaderImpl()
Method Detail

read2CharArray

public char[] read2CharArray(String path)
                      throws IOException
Description copied from interface: SimpleFileReader
Read file content(convert to char array).

This method go through the following steps to read target path.
(1) try to read the path in class path resource
(2) try to read from full path on os file system

Specified by:
read2CharArray in interface SimpleFileReader
Parameters:
path - readable file resource of file path
Returns:
file content
Throws:
IOException - file read error
See Also:
SimpleFileReader.read2CharArray(String)

read2CharArray

public char[] read2CharArray(File file)
                      throws IOException
Description copied from interface: SimpleFileReader
Read file content(convert to char array).

Specified by:
read2CharArray in interface SimpleFileReader
Parameters:
file - readable file object
Returns:
file content
Throws:
IOException - file read error
See Also:
SimpleFileReader.read2CharArray(File)

read2CharArray

public char[] read2CharArray(ClassPathResource resourcePath)
                      throws IOException
Description copied from interface: SimpleFileReader
Read resource content(convert to char array).

Specified by:
read2CharArray in interface SimpleFileReader
Parameters:
resourcePath - readable class path resource
Returns:
file content
Throws:
IOException
See Also:
jp.sourceforge.simplefh.SimpleFileReader#read2CharArray(jp.sourceforge .simplefh.ClassPathResource)

read2ByteArray

public byte[] read2ByteArray(String path)
                      throws IOException
Description copied from interface: SimpleFileReader
Read file content(convert to byte array).

This method go through the following steps to read target path.
(1) try to read the path in class path resource
(2) try to read from full path on os file system

Specified by:
read2ByteArray in interface SimpleFileReader
Parameters:
path - readable file resource of file path
Returns:
file content
Throws:
IOException - file read error
See Also:
SimpleFileReader.read2ByteArray(String)

read2ByteArray

public byte[] read2ByteArray(File file)
                      throws IOException
Description copied from interface: SimpleFileReader
Read file content(convert to byte array).

Specified by:
read2ByteArray in interface SimpleFileReader
Parameters:
file - readable file object
Returns:
file content
Throws:
IOException - file read error
See Also:
SimpleFileReader.read2ByteArray(File)

read2ByteArray

public byte[] read2ByteArray(ClassPathResource resourcePath)
                      throws IOException
Description copied from interface: SimpleFileReader
Read resource content(convert to byte array).

Specified by:
read2ByteArray in interface SimpleFileReader
Parameters:
resourcePath - readable class path resource
Returns:
file content
Throws:
IOException
See Also:
jp.sourceforge.simplefh.SimpleFileReader#read2ByteArray(jp.sourceforge .simplefh.ClassPathResource)

read2StringLineList

public List<String> read2StringLineList(String path)
                                 throws IOException
Description copied from interface: SimpleFileReader
Read file content(convert to String List).

This method go through the following steps to read target path.
(1) try to read the path in class path resource
(2) try to read from full path on os file system

Specified by:
read2StringLineList in interface SimpleFileReader
Parameters:
path - readable file resource of file path
Returns:
file content
Throws:
IOException - file read error
See Also:
SimpleFileReader.read2StringLineList(String)

read2StringLineList

public List<String> read2StringLineList(File file)
                                 throws IOException
Description copied from interface: SimpleFileReader
Read file content(convert to String List).

Specified by:
read2StringLineList in interface SimpleFileReader
Parameters:
file - readable file object
Returns:
file content
Throws:
IOException - file read error
See Also:
SimpleFileReader.read2StringLineList(File)

read2StringLineList

public List<String> read2StringLineList(ClassPathResource resourcePath)
                                 throws IOException
Description copied from interface: SimpleFileReader
Read resource content(convert to String List).

Specified by:
read2StringLineList in interface SimpleFileReader
Parameters:
resourcePath - readable class path resource
Returns:
file content
Throws:
IOException
See Also:
jp.sourceforge.simplefh.SimpleFileReader#read2StringLineList(jp.sourceforge .simplefh.ClassPathResource)

read2StringLineArray

public String[] read2StringLineArray(String path)
                              throws IOException
Description copied from interface: SimpleFileReader
Read file content(convert to String array).

This method go through the following steps to read target path.
(1) try to read the path in class path resource
(2) try to read from full path on os file system

Specified by:
read2StringLineArray in interface SimpleFileReader
Parameters:
path - readable file resource of file path
Returns:
file content
Throws:
IOException - file read error
See Also:
SimpleFileReader.read2StringLineArray(String)

read2StringLineArray

public String[] read2StringLineArray(File file)
                              throws IOException
Description copied from interface: SimpleFileReader
Read file content(convert to String array).

Specified by:
read2StringLineArray in interface SimpleFileReader
Parameters:
file - readable file object
Returns:
file content
Throws:
IOException - file read error
See Also:
SimpleFileReader.read2StringLineArray(File)

read2StringLineArray

public String[] read2StringLineArray(ClassPathResource resourcePath)
                              throws IOException
Description copied from interface: SimpleFileReader
Read resource content(convert to String array).

Specified by:
read2StringLineArray in interface SimpleFileReader
Parameters:
resourcePath - readable class path resource
Returns:
file content
Throws:
IOException
See Also:
jp.sourceforge.simplefh.SimpleFileReader#read2StringLineArray(jp.sourceforge .simplefh.ClassPathResource)

getEncodingToRead

public String getEncodingToRead()
Description copied from interface: SimpleFileReader
Get encoding to read.

Specified by:
getEncodingToRead in interface SimpleFileReader
Returns:
encoding

setEncodingToRead

public SimpleFileReader setEncodingToRead(String encodingToRead)
Description copied from interface: SimpleFileReader
Set encoding to read.

Specified by:
setEncodingToRead in interface SimpleFileReader
Parameters:
encodingToRead - encoding
Returns:
reader

getDefaultArrayLength

public Integer getDefaultArrayLength()
Description copied from interface: SimpleFileReader
Get default array length to buffering.

Specified by:
getDefaultArrayLength in interface SimpleFileReader
Returns:
buffering array length

setDefaultArrayLength

public SimpleFileReader setDefaultArrayLength(Integer defaultArrayLength)
Description copied from interface: SimpleFileReader
Set default array length to buffering.

Specified by:
setDefaultArrayLength in interface SimpleFileReader
Parameters:
defaultArrayLength - default array length to buffering
Returns:
reader