/* * To change this template, choose Tools | Templates * and open the template in the editor. */ package socius.telas.util; import java.rmi.RemoteException; import socius.adapter.Arquivo; /** * * @author lucas */ public class ItemListaArquivos { private Arquivo arquivo; public ItemListaArquivos(Arquivo arquivo) { this.arquivo = arquivo; } @Override public String toString() { try { StringBuilder b = new StringBuilder(); b.append(arquivo.getFile().getName()); b.append(" ("); b.append(String.format("%.2f", ((float) arquivo.getTamanho()) / 1024 / 1024)); b.append(" MB)"); return b.toString(); } catch(RemoteException ex) { return "erro"; } } public Arquivo getArquivo() { return arquivo; } }