1 6 7 package com.sun.enterprise.config.backup.appserver; 8 import java.io.*; 9 import java.util.*; 10 import com.sun.enterprise.config.backup.BackupRestore; 11 import com.sun.enterprise.config.backup.BackupRestoreImpl; 12 import com.sun.enterprise.config.backup.status.StatusConstants; 13 14 15 19 public class Util { 20 private static final String BACKUP_ENVIRONMENT_PATH = 21 "/com/sun/enterprise/config/backup/appserver/BackupEnvironment.properties"; 22 23 24 public Util() { 25 } 26 27 private static void loadProperties() throws Exception { 28 try { 29 InputStream i = Util.class.getResourceAsStream( BACKUP_ENVIRONMENT_PATH ); 30 Properties p = new Properties(); 31 p.load(i); 32 33 if(p == null) return; 34 35 } catch (Exception io) { 38 throw new RuntimeException ("ERROR in loading properties", io); 41 } 42 } 43 44 static BackupRestore getBackupRestore() { 45 try { 46 loadProperties(); 47 return new BackupRestoreImpl(StatusConstants.TYPE_OFFLINE); 48 } catch(Exception e) { 49 throw new RuntimeException ("ERROR creating BackupRestoreImpl", e); 51 } 52 } 53 } 54 | Popular Tags |