Back to project page image-loader.
The source code is released under:
Apache License
If you think the Android project image-loader listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.
package com.novoda.imageloader.demo.provider; // w w w .j a va 2 s. c o m import java.io.*; import java.util.ArrayList; import java.util.List; public class SqlFile { private BufferedReader reader; private List<String> statements; private boolean inComment = false; public void parse(Reader in) throws IOException { reader = new BufferedReader(in); statements = new ArrayList<String>(); String line = null; while ((line = reader.readLine()) != null) { line = line.trim(); if (line.length() == 0) { continue; } if (line.startsWith("--")) { continue; } if (line.startsWith("/*")) { inComment = true; continue; } if (line.endsWith("*/") && inComment) { inComment = false; continue; } if (inComment) { continue; } statements.add(line); } reader.close(); } public List<String> getStatements() { return statements; } public static List<String> statementsFrom(Reader reader) throws IOException { SqlFile file = new SqlFile(); file.parse(reader); return file.getStatements(); } public static List<String> statementsFrom(File sqlfile) throws IOException { FileReader reader = new FileReader(sqlfile); SqlFile file = new SqlFile(); file.parse(reader); return file.getStatements(); } }