2012-06-25 31 views
0

我想以編程方式讀取Kerberos受保護的WebDAV服務器的文件。支持Kerberos的WebDAV庫?

I tried添加Kerberos支持到Sardine(Java),但它似乎不工作。

是否有支持Kerberos的WebDAV庫? (任何語言,最好是開源的)

+0

你有沒有最終解決這個問題? –

+0

@PeterVanleeuwen:不,不幸的。但沙丁魚可能同時添加了該功能? –

回答

0

傳輸庫需要Kerberos支持而不是WebDAV庫。嘗試修復該傳輸庫。甲骨文的URLConnection就是這麼做的。

+0

典型的WebDAV庫*需要*用戶名/密碼,這在Kerberos環境中顯然不起作用。順便說一下,「修復傳輸庫」完全超出了範圍。 –

+0

什麼是典型的WebDAV庫?沒有這樣的。所以,如果你不能解決它。算了吧。你也許可以改變這個庫。 –

1

我發現的解決方案是使用Sardine方法類來擴展HttpRequestBase和Apache HttpClient。您需要同時使用的HttpClient HttpClient的和共贏

try { 
    CloseableHttpClient client = WinHttpClients.createDefault(); 

    HttpMove move = new HttpMove(fullSource, fullDestination, false); 

    CloseableHttpResponse response = client.execute(move);   
    if (response.getStatusLine().getStatusCode() == 201){ 
     System.out.println("Yay"); 
    } 

} catch (Exception e) { 
    e.printStackTrace(); 
} 

throw new Exception("Unable to move node"); 

這裏使用的依賴關係(gradle這個形式)

  • 編譯組: 'com.github.lookfirst',名稱: '沙丁魚' ,版本: '5. +'
  • 編譯組: 'org.apache.httpcomponents',名稱: 'HttpClient的', 版本: '4.5 +'。
  • 編譯組: 'org.apache.httpcomponents' ,名稱:'httpclient-win', 版本: '4.5。+'
+0

@NicolasRaoul如果我有更多的時間,我可能會添加到github上的沙丁魚項目。我知道你以前嘗試過! –