01-15-2010 10:51 AM
public void testConnect() {
HttpClient client = new HttpClient();
String myUrl = "http://'+host+':'+port+'/alfresco/service/sample/folder/Alfresco";
// set the credential using OmniFind API password /
client.getState().setCredentials(new AuthScope(host, port,"mondomaine"),
new org.apache.commons.httpclient.NTCredentials(
"user", "pass", "alfresco", "mondomaine" ));
GetMethod method = null;
System.out.println(myUrl);
try {
method = new GetMethod(myUrl);
} catch (Exception e) {
e.printStackTrace();
}
method.setDoAuthentication(true);
int status = 0;
String resultString = "";
try {
// execute the delete method
status = client.executeMethod(method);
System.out.println("status = "+status);
resultString = method.getResponseBodyAsStream().toString();
System.out.println(">>> "+resultString+" <<<");
} catch (Exception e) {
e.printStackTrace();
} finally {
method.releaseConnection();
}
}02-03-2010 12:03 PM
02-04-2010 05:30 AM
02-04-2010 05:39 AM
Tags
Find what you came for
We want to make your experience in Hyland Connect as valuable as possible, so we put together some helpful links.