简体   繁体   English

eXist-db嵌入式模式备份/恢复

[英]eXist-db embedded mode backup / restore

I'm attempting to use eXist-db in embedded mode in a Java program to produce an interactive fiction game. 我试图在Java程序中以嵌入模式使用eXist-db来生成交互式小说游戏。

Is there any information on invoking backups and restores from within my own java application, so as to initially load the story and all files, and then to perform a save/restore function? 是否有关于从我自己的java应用程序中调用备份和恢复的信息,以便最初加载故事和所有文件,然后执行保存/恢复功能?

Also, any suggestions on how to format my xml for such use would be appreciated. 此外,任何关于如何格式化我的xml用于此类用途的建议将不胜感激。

You can invoke the backup directly by passing in the URI of your embedded eXist instance. 您可以通过传入嵌入式eXist实例的URI直接调用备份。 For example: 例如:

import org.exist.backup.Backup;

//omitted for brevity

final Backup backup = new Backup("admin, "adminPass", "xmldb:exist:///db") 
backup.backup(false, null);

You can use any collection path instead of just /db . 您可以使用任何收集路径而不仅仅是/db Also if you are running this from within a Swing application you can use: 此外,如果您在Swing应用程序中运行它,您可以使用:

backup.backup(true, frame);

To have a backup dialog appear. 要显示备份对话框。

Hope that helps. 希望有所帮助。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM