// Path: core/src/main/java/org/mskcc/cbio/oncokb/apiModels/download/FileExtension.java
// public enum FileExtension {
//     JSON(".json"), TEXT(".txt"), MARK_DOWN(".md"), GZ(".gz");
//     String extension;
// 
//     FileExtension(String extension) {
//         this.extension = extension;
//     }
// 
//     public String getExtension() {
//         return extension;
//     }
// 
//     public void setExtension(String extension) {
//         this.extension = extension;
//     }
// }


import java.io.BufferedReader;
import java.io.File;
import java.io.FileInputStream;
import java.io.FilenameFilter;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.net.HttpURLConnection;
import java.net.MalformedURLException;
import java.net.HttpURLConnection;
import java.net.URL;
import java.util.ArrayList;
import java.util.List;
import org.apache.commons.lang3.StringUtils;
import org.apache.poi.xwpf.usermodel.XWPFDocument;
import org.apache.poi.xwpf.usermodel.XWPFParagraph;
import org.mskcc.cbio.oncokb.apiModels.download.FileExtension;
import org.mskcc.cbio.oncokb.apiModels.download.FileName;
        return StringUtils.join(lines, "\n");
    }

    public static List<String> readTrimedLinesStream(InputStream is) throws IOException {
        return readLinesStream(is, true);
    }

    /**
     * read a stream and return lines
     * @param is
     * @return
     * @throws IOException
     */
    public static List<String> readLinesStream(InputStream is, boolean trim) throws IOException {
        BufferedReader in = new BufferedReader(new InputStreamReader(is, "UTF-8"));

        List<String> lines = new ArrayList<String>();
        String line;
        while ((line = in.readLine()) != null) {
            if (trim) {
                line = line.trim();
            }
            if (!line.isEmpty())
                lines.add(line);
        }
        in.close();

        return lines;
    }

// Path: core/src/main/java/org/mskcc/cbio/oncokb/apiModels/download/FileExtension.java
// public enum FileExtension {
//     JSON(".json"), TEXT(".txt"), MARK_DOWN(".md"), GZ(".gz");
//     String extension;
// 
//     FileExtension(String extension) {
//         this.extension = extension;
//     }
// 
//     public String getExtension() {
//         return extension;
//     }
// 
//     public void setExtension(String extension) {
//         this.extension = extension;
//     }
// }


// Path: core/src/main/java/org/mskcc/cbio/oncokb/util/FileUtils.java
import java.io.BufferedReader;
import java.io.File;
import java.io.FileInputStream;
import java.io.FilenameFilter;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.net.HttpURLConnection;
import java.net.MalformedURLException;
import java.net.HttpURLConnection;
import java.net.URL;
import java.util.ArrayList;
import java.util.List;
import org.apache.commons.lang3.StringUtils;
import org.apache.poi.xwpf.usermodel.XWPFDocument;
import org.apache.poi.xwpf.usermodel.XWPFParagraph;
import org.mskcc.cbio.oncokb.apiModels.download.FileExtension;
import org.mskcc.cbio.oncokb.apiModels.download.FileName;

        return StringUtils.join(lines, "\n");
    }

    public static List<String> readTrimedLinesStream(InputStream is) throws IOException {
        return readLinesStream(is, true);
    }

    /**
     * read a stream and return lines
     * @param is
     * @return
     * @throws IOException
     */
    public static List<String> readLinesStream(InputStream is, boolean trim) throws IOException {
        BufferedReader in = new BufferedReader(new InputStreamReader(is, "UTF-8"));

        List<String> lines = new ArrayList<String>();
        String line;
        while ((line = in.readLine()) != null) {
            if (trim) {
                line = line.trim();
            }
            if (!line.isEmpty())
                lines.add(line);
        }
        in.close();

        return lines;
    }

    public static String getFileName(FileName fileName, FileExtension fileExtension) {