我正在使用Lotus Domino服务器8.5.2。使用Java预定代理,我可以将多个Lotus Domino Documents的附件提取到文件系统中(win 32)。想法是在提取后我需要为文件添加一些元数据并将文件上传到另一个系统。
有人知道,或者可以给我一些提示(最好是使用Java)我如何将一些元数据写入提取的文件?我需要添加一些关键字,更改作者等等。我理解Lotus Domino 8.5.2 supports Java 6
谢谢你!亚历。
答案 0 :(得分:0)
根据this answer,Java 7具有操作Windows元数据的本机功能,但Java 6没有。
它确实说您可以使用Java Native Access(JNA)来调用本机DLL,这意味着您应该能够使用dsofile.dll来操作元数据。使用JNA从here访问msvcrt.dll中的“puts”函数的示例(找不到任何特定于dsofile.dll的示例):
接口
package CInterface;
import com.sun.jna.Library;
public interface CInterface extends Library
{
public int puts(String str);
}
示例类
// JNA Demo. Scriptol.com
package CInterface;
import com.sun.jna.Library;
import com.sun.jna.Native;
import com.sun.jna.Platform;
public class hello
{
public static void main(String[] args)
{
String mytext = "Hello World!";
if (args.length != 1)
{
System.err.println("You can enter your own text between quotes...");
System.err.println("Syntax: java -jar /jna/dist/demo.jar \"myowntext\"");
}
else
mytext = args[0];
// Library is c for unix and msvcrt for windows
String libName = "c";
if (System.getProperty("os.name").contains("Windows"))
{
libName = "msvcrt";
}
// Loading dynamically the library
CInterface demo = (CInterface) Native.loadLibrary(libName, CInterface.class);
demo.puts(mytext);
}
}