/* * To change this template, choose Tools | Templates * and open the template in the editor. */ package LOGIC; import java.io.FileInputStream; import java.io.FileOutputStream; import java.io.IOException; import java.io.ObjectInputStream; import java.io.ObjectOutputStream; import java.io.Serializable; import java.util.LinkedList; /** * * @author dalayalmeida */ public class PathFDR implements Serializable{ public static String path = "/home/sarah/fdr2/scripts/"; public String getPath() { return path; } public void setPath(String path) { this.path = path; } /* public void serializaPath(String path) { //LinkedList lista = saves; this.path = path; String arquivo = "Path.dat"; FileOutputStream arq = null; ObjectOutputStream out = null; try { //arquivo no qual os dados vao ser gravados arq = new FileOutputStream(arquivo); //objeto que vai escrever os dados out = new ObjectOutputStream(arq); out.reset(); //escreve todos os dados out.writeObject(this); } catch (IOException ex) { ex.printStackTrace(); } finally { try { arq.close(); out.close(); } catch (IOException ex) { ex.printStackTrace(); } } } public String deserializaLista() { String arquivo = "path.dat"; FileInputStream arqLeitura = null; ObjectInputStream in = null; PathFDR aux = new PathFDR(); //LinkedList lista = null; try { //arquivo onde estao os dados serializados arqLeitura = new FileInputStream(arquivo); //objeto que vai ler os dados do arquivo in = new ObjectInputStream(arqLeitura); aux = (PathFDR) in.readObject(); //recupera os dados //lista = (List) in.readObject(); } catch (ClassNotFoundException ex) { ex.printStackTrace(); } catch (IOException ex) { ex.printStackTrace(); } finally { try { arqLeitura.close(); // in.close(); } catch (IOException ex) { ex.printStackTrace(); } } return aux.path; }*/ }