AnsweredAssumed Answered

when downloading a document from repository getting internal error

Question asked by nareshvy on Dec 1, 2016
Latest reply on Dec 2, 2016 by nareshvy

Hi, Im Using alfresco community 5 

my project config are : java 8,wildfly 8 ,

so will cmis will work on it, because i was trying since two days .i unable success on download any specific document . here follow some my code

 

String fileName = "abcd.docx";
String authURI = "http://127.0.0.1:8090/alfresco/service/api/login";
String username = "user1";
String password = "user1";
HttpUtils httpUtils = new HttpUtils();
String authTicket = ConstantsTemp.EMPTY;
try {
authTicket = httpUtils.getAuthTicket(authURI, username, password);
String url = "http://127.0.0.1:8090/alfresco/download/direct?path=/app:company_home/st:testuserone/cm:documentLibrary/cm:Test/"
+ fileName + "?alf_ticket=" + authTicket;

System.out.println(url);
HttpClient client = new HttpClient();
GetMethod metodoGet = new GetMethod(url);
int status = client.executeMethod(metodoGet);
System.out.println(status);
byte[] file = metodoGet.getResponseBody();

metodoGet.releaseConnection();

 

} catch (Exception e) {

}

error : 

500
Internal Server Error

Folder not found: /st:testuserone (in workspace://SpacesStore/329bbf25-9ebb-4f47-845c-ddb16dd15852)

 

 

 

 

commons-httpclient-3.1.jar

commons-io-2.4.jar

 

and let me know can possible to retrieve list of file(link to download) from any one directory(folder)

Outcomes