/**
 *  wrongPowder is developed by wrong-entertainment & powder
 *
 *
 *  Copyright 2011 Paul Vollmer & Tim Pulver
 *  paulvollmer.net
 *  vollmerpaul@yahoo.de
 *  timpulver.de
 *  pulver.tim@googlemail.com
 * 
 *  This file is part of wrongPowder library.
 *
 *  wrongPowder is distributed in the hope that it will be useful,
 *  but WITHOUT ANY WARRANTY; without even the implied warranty of
 *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
 *  GNU Lesser General Public License for more details.
 *  
 *  You should have received a copy of the GNU Lesser General Public License
 *  along with wrongPowder. If not, see <http://www.gnu.org/licenses/>.
 * 
 *  @author		##author##
 *  @modified	##date##
 *  @version	##version##
 */

package wrongPowder.io;

import java.io.BufferedReader;
import processing.core.PApplet;
import wrongPowder.io.Log;





/**
 * Reader
 * 
 * @example reader_basic 
 */
public class Reader {
	
	PApplet p5;
	
	// Logger Variable.
	Log log = new Log(p5);
	
	
	
	
	
	/**
	 * A Constructor, usually called in the setup() method in your sketch to
	 * initialize and start the library.
	 * 
	 * @example log_basic
	 */
	public Reader(PApplet p) {
		p5 = p;
	}
	
	/**
	 * A Constructor, usually called in the setup() method in your sketch to
	 * initialize and start the library.
	 * 
	 * @example reader_basic
	 * @param fileName
	 *
	public Reader(PApplet p, String fileName) {
		p5 = p;
		
		read(fileName);
	}*/
	
	
	
	
	
	/**
	 * Load a file from path filepath.
	 * 
	 * @param filepath File path.
	 * @return File String source.
	 */
	public String load(String filepath) {
		log.info("READER Start reading filepath: "+filepath);
		
		String temp = "";
		
		BufferedReader reader = p5.createReader(filepath);
		
		try {
			String line;
			// save each line to sourcecode variable
			while ((line = reader.readLine()) != null) {
			    temp = temp+line;
			    //System.out.println(line);
			}
			
			log.init("File ready");
			
		}
		catch (Exception e) {
			//e.printStackTrace(); 
			log.init(filepath+" No wordtype available ");
			
		}
		
		return temp;
	}
	
	
	
	
	
	/**
	 * Read a file from path filepath.
	 * 
	 * @param filepath File path.
	 * @return File String source.
	 */
	public String[] load(String[] filepath) {
		String[] temp = new String[filepath.length];
		
		for(int i=0; i<temp.length; i++) {
			temp[i] =  load(filepath[i]);
			System.out.println(i);
		}
		
		return temp;
	}


}
@@ -836,35 +836,8 @@
 et;%0A
-import wrongPowder.io.Log;%0A
 %0A%0A%0A%0A
@@ -928,55 +928,8 @@
 ;%0A%09%0A
-%09// Logger Variable.%0A%09Log log = new Log(p5);%0A%09%0A
 %09%0A%09%0A
@@ -1129,263 +1129,8 @@
 %7D%0A%09%0A
-%09/**%0A%09 * A Constructor, usually called in the setup() method in your sketch to%0A%09 * initialize and start the library.%0A%09 * %0A%09 * @example reader_basic%0A%09 * @param fileName%0A%09 *%0A%09public Reader(PApplet p, String fileName) %7B%0A%09%09p5 = p;%0A%09%09%0A%09%09read(fileName);%0A%09%7D*/%0A%09%0A
 %09%0A%09%0A
@@ -1290,67 +1290,8 @@
 ) %7B%0A
-%09%09log.info(%22READER Start reading filepath: %22+filepath);%0A%09%09%0A
 %09%09St
@@ -1550,43 +1550,8 @@
 %09%09%7D%0A
-%09%09%09%0A%09%09%09log.init(%22File ready%22);%0A%09%09%09%0A
 %09%09%7D%0A
@@ -1608,16 +1608,26 @@
 %0A%09%09%09
-log.init
+System.out.println
 (fil
@@ -1975,24 +1975,26 @@
 ath%5Bi%5D);%0A%09%09%09
+//
 System.out.p
@@ -2000,16 +2000,30 @@
 println(
+%22Load file: %22+
 i);%0A%09%09%7D%0A

Remove log support