properties.getProperty(Property.LOG_DEVICE_AT_BACKUP);
}
}
getLogStorageFactory();
StorageFile logDir;
logDir = logStorageFactory.newStorageFile(
LogFactory.LOG_DIRECTORY_NAME);
//remove the log directory in case of restoreFrom
//if it exist, this happens if the log device is on seperate
//location than the db home.
if (isRestoreFrom && logDevice != null)
{
if(!privRemoveDirectory(logDir))
{
//it may be just a file, try deleting it
if(!privDelete(logDir))
{
throw StandardException.newException(
SQLState.UNABLE_TO_REMOVE_DATA_DIRECTORY,
getLogDirPath( logDir));
}
}
}
// if it is a create/restore from backup,
// create the log directory.
if (isCreateFrom || isRestoreFrom) {
createLogDirectory();
}
File backupLogDir = new File(backupPath, LogFactory.LOG_DIRECTORY_NAME);
String[] logfilelist = privList(backupLogDir);
if(logfilelist !=null)
{
for (int i = 0; i < logfilelist.length; i++)
{
File blogFile = new File(backupLogDir, logfilelist[i]);
StorageFile clogFile = logStorageFactory.newStorageFile(logDir, logfilelist[i]);
if(!privCopyFile(blogFile , clogFile))
{
throw
StandardException.newException(SQLState.UNABLE_TO_COPY_LOG_FILE, blogFile, clogFile);
}