Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package bin;
- import java.net.*;
- import java.util.ArrayList;
- import java.util.List;
- import java.io.*;
- public class CurrencyXMLFile {
- private String xmlFileLoc; //Lokalizacja pliku XML
- private URL xmlURL;
- private BufferedReader brFile;
- public CurrencyXMLFile(String xmlFileLoc) throws Exception{
- this.xmlFileLoc=xmlFileLoc;
- openFile();
- }
- public CurrencyXMLFile(){
- }
- public BufferedReader getFile(){
- return brFile;
- }
- public void closeFile() throws Exception{
- if(brFile!=null){
- brFile.close();
- }
- }
- public void openFile() throws Exception{
- xmlURL=new URL(xmlFileLoc);
- brFile=null;
- brFile = new BufferedReader(new InputStreamReader(xmlURL.openStream()));
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement