1 24 25 package com.mckoi.database.procedure; 26 27 import com.mckoi.database.ProcedureConnection; 28 import com.mckoi.database.ProcedureException; 29 import java.io.File ; 30 import java.io.IOException ; 31 32 39 40 public class SystemBackup { 41 42 45 public static String invoke(ProcedureConnection db_connection, 46 String path) { 47 48 File f = new File (path); 49 if (!f.exists() || !f.isDirectory()) { 50 throw new ProcedureException("Path '" + path + 51 "' doesn't exist or is not a directory."); 52 } 53 54 try { 55 db_connection.getDatabase().liveCopyTo(f); 56 return path; 57 } 58 catch (IOException e) { 59 e.printStackTrace(); 60 throw new ProcedureException("IO Error: " + e.getMessage()); 61 } 62 63 } 64 65 } 66 67 | Popular Tags |