This class saves array lists into files and lets you read them easily. Code:java public class ListFile { File file; String path; public ListFile(String path, String extension) { this.path = path + "." + extension; this.file = new File(this.path); try { this.file.createNewFile(); } catch (Exception e) { e.printStackTrace(); } } public ArrayList<String> read() { ArrayList<String> list = new ArrayList<String>(); try { BufferedReader br = new BufferedReader(new FileReader(path)); String line = null; while ((line = br.readLine()) != null) { list.add(line); } br.close(); } catch(Exception e) { e.printStackTrace(); } return list; } public void write(ArrayList<String> list) { try { BufferedWriter bw = new BufferedWriter(new FileWriter(path, true)); for(String line : list) { bw.append(line); bw.newLine(); } bw.close(); } catch(Exception e) { e.printStackTrace(); } }} Here is some example usage Code:java ListFile file = new ListFile("/path/to/file", "txt");ArrayList<String> list = new ArrayList<String>();list.add("Welcome to the server!");list.add("Use /help for help");file.write(list); This writes the array list to the file. The file "file.txt" would look like this Code: Welcome to the server! Use /help for help To get the array list from the file you could do this. The read() method returns an array list that you can iterate through. Code:java ListFile file = new ListFile("/path/to/file", "txt");for(String line : file.read()) { System.out.println(line);} The output would be Code: Welcome to the server! Use /help for help This could be useful for motds and stuff I guess. I just started using buffered streams so comment if I did it wrong
Lets talk about my friend Ian who's computer crashed after he got all that stuff. Now he can't download stuff. Rare thing.. but... Billions of people.
I've gone through multiple computer crashes and recovered them. If your friend attempts to download stuff with a crashed computer, I think he needs to get his priority straight... This conversation is off-topic... I think we need to return to the topic.
If you can't download stuff, then you need to talk the the website owner, your ISP, or your computer admin. https://code.google.com/p/snakeyaml/ Here is the YAML api that Bukkit uses (I think, or at least a variation of). The download link for that works fine.