Code example for FileReader

Methods: close

0
 
        private static Set<String> readLocations(String fileName) {
            Set<String> ret = new HashSet<String>();
            Reader r = null;
            try { 
                r = new FileReader(fileName);
                ret.addAll(IOUtils.readLines(r));
            } catch (FileNotFoundException e) {
                throw new GenesFinderException("File not found: " + fileName);
            } catch (IOException ex) {
                throw new GenesFinderException("Error reading from file " + fileName);
            } finally { 
                if (r != null) {
                    try { 
                        r.close();
                    } catch (IOException e) {
                        // ignore 
                    } 
                } 
            } 
            return ret;