Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public String[] citajDatoteku(String datoteka) {
- String[] splitStr = null;
- File file = new File(datoteka);
- if (file.exists() && !file.isDirectory()) {
- try {
- FileInputStream fs = new FileInputStream(file);
- int skipLines = 7;
- BufferedReader br = new BufferedReader(new InputStreamReader(fs));
- String line;
- try {
- while ((line = br.readLine()) != null) {
- if (skipLines-- > 0) {
- continue;
- } else {
- splitStr = line.split("=");
- }
- }
- } catch (IOException ex) {
- Logger.getLogger(RadnaDretva.class.getName()).log(Level.SEVERE, null, ex);
- }
- } catch (FileNotFoundException ex) {
- Logger.getLogger(RadnaDretva.class.getName()).log(Level.SEVERE, null, ex);
- }
- } else {
- System.out.println("Datoteka ne postoji");
- }
- return splitStr;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement