Changeset 402


Ignore:
Timestamp:
03/20/12 11:52:15 (12 years ago)
Author:
sherbold
Message:
  • modified de.ugoe.cs.util.FileTools? such that it does not always choose \r\n as carriage return, but instead the variant used by the operating system, i.e., \n with Linux and Macs, \r\n with Windows
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/JavaHelperLib/src/de/ugoe/cs/util/FileTools.java

    r330 r402  
    3131         * <p> 
    3232         * Returns an array of the lines contained in a file. The line separator is 
    33          * "\r\n". 
     33         * {@link StringTools#ENDLINE}. 
    3434         * </p> 
    3535         *  
     
    4545        public static String[] getLinesFromFile(String filename) 
    4646                        throws IOException, FileNotFoundException { 
    47                 return getLinesFromFile(filename, true); 
     47                boolean carriageReturn = true; 
     48                if( StringTools.ENDLINE.equals("\n") ) { 
     49                        carriageReturn = false; 
     50                } 
     51                return getLinesFromFile(filename, carriageReturn); 
    4852        } 
    4953 
Note: See TracChangeset for help on using the changeset viewer.