2012-09-04 33 views
0

我正在使用Lotus Domino服務器8.5.2。使用Java調度代理,我可以將幾個Lotus Domino文檔的附件提取到文件系統(win 32)中。這個想法是,在提取之後,我需要爲文件添加一些元數據並將文件上傳到另一個系統。Lotus Domino 8.5.2 Java代理,將元數據寫入提取的附件?

有人知道,或者可以給我一些提示(最好使用Java)我怎麼可以寫一些元數據到提取的文件?我需要添加一些關鍵字,改變作者,等等。據我所知Lotus Domino 8.5.2 supports Java 6

謝謝!

Alex。

+0

你問什麼類型的文件? –

+0

你好rhsatrhs。任何類型的附件,如Office文件,CAD,EXE,RAR和Zip文件等等。有時Zip和RAR文件被分割成幾個文件... –

回答

0

根據this answer,Java 7具有操縱Windows元數據的本機功能,但Java 6不具備這一功能。

它的確表示您可以使用Java Native Access(JNA)調用本機DLL,這意味着您應該可以使用dsofile.dll來操作元數據。從使用JNA從MSVCRT.DLL訪問 「放」 功能的實施例here(找不到特定於dsofile.dll任何實施例):

接口

package CInterface; 

import com.sun.jna.Library; 

public interface CInterface extends Library 
{ 
     public int puts(String str); 
}  

Sample類

// 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); 
    } 
} 
+0

謝謝Rob!我會嘗試你的答案。我會發布結果:-) –

+0

感謝接受任何問題得到這個工作? –

+0

仍然在草案,但似乎是正確的道路。我會盡快發佈可讀的內容;-) –

相關問題