1 6 7 package com.sun.enterprise.config.backup.status; 8 9 import java.util.Date ; 10 import java.io.File ; 11 import java.io.FileInputStream ; 12 import java.io.EOFException ; 13 import com.sun.enterprise.config.backup.BackupException; 14 import com.sun.enterprise.config.backup.utils.BackupHelper; 15 import com.sun.enterprise.config.backup.utils.FactoryHelper; 16 17 22 public class ListBackupStatus extends BackupStatus { 23 24 private String _tmpStringValue; 25 public ListBackupStatus(File f) throws BackupException { 26 init(f); 27 } 28 29 33 private void init(File f) throws BackupException { 34 38 initStatusInfo(f); 40 } 41 42 private void initStatusInfo(File file) { 43 FileInputStream fis = null; 44 String res = ""; 45 File fReadMe = new File (file, FactoryHelper.getEnv().getStatusInfoFileName()); 46 try { 47 fis = new FileInputStream (fReadMe); 48 byte[] buf = new byte[1000]; 49 50 int len = 0; 51 try { 52 len = fis.read(buf, 0, buf.length); 53 } catch (EOFException eof) { 54 } 55 res = new String (buf).trim(); 56 57 } catch(Exception e) { 58 } finally { 59 try { 60 fis.close(); 61 } catch(Exception ex1) {} 62 } 63 _tmpStringValue = res; 64 } 65 79 public String toString() { 80 return _tmpStringValue; 81 } 82 } 83 | Popular Tags |