package study02; import java.io.FileInputStream; import java.io.IOException; /** * @author taichi.yamazaki * */ public class FileTest { /** * @param name * @return * @throws BadDataException */ public Data getData(String name) throws BadDataException { FileInputStream inputStream = null; try { inputStream = new FileInputStream(name); return read(inputStream); } catch (IOException e) { throw new BadDataException(); } finally { try { if (inputStream != null) { inputStream.close(); } } catch (IOException e) { // } } } /** * @param inputStream * @return * @throws IOException */ private Data read(FileInputStream inputStream) throws IOException { // ȗ return null; } /** * @author taichi.yamazaki * */ private class BadDataException extends Exception {} /** * @author taichi.yamazaki * */ private class Data {} }