Java tutorial
//package com.java2s; /************************************************************************ VisualOn Proprietary Copyright (c) 2013, VisualOn Incorporated. All Rights Reserved VisualOn, Inc., 4675 Stevens Creek Blvd, Santa Clara, CA 95051, USA All data and information contained in or disclosed by this document are confidential and proprietary information of VisualOn, and all rights therein are expressly reserved. By accepting this material, the recipient agrees that this material and the information contained therein are held in confidence and in trust. The material may only be used and/or disclosed as authorized in a license agreement controlling such use and disclosure. ************************************************************************/ import java.io.BufferedReader; import java.io.File; import java.io.FileNotFoundException; import java.io.FileReader; import java.io.IOException; import java.util.List; public class Main { /** Retrieve list of media sources */ public static boolean ReadUrlInfoToList(List<String> listUrl, String configureFile) { String sUrl, line = ""; sUrl = configureFile; File UrlFile = new File(sUrl); if (!UrlFile.exists()) return false; FileReader fileread; try { fileread = new FileReader(UrlFile); BufferedReader bfr = new BufferedReader(fileread); try { while (line != null) { line = bfr.readLine(); if (line != null) listUrl.add(line); } fileread.close(); } catch (IOException e) { e.printStackTrace(); } } catch (FileNotFoundException e) { e.printStackTrace(); } return true; } }