03-26-2009 07:12 AM
03-30-2009 09:31 AM
04-01-2009 03:24 AM
04-01-2009 09:23 AM
byte[] contentFile = null;
WebServiceFactory.setEndpointAddress(ALFRESCO_URL);
AuthenticationService authenticationService = WebServiceFactory.getAuthenticationService();
AuthenticationUtils.startSession(USERNAME, PASSWORD);
String ticket = WebServiceFactory.getCurrentTicket();
Reference ref = node.getReference();
Content[] readResult = contentService.read(new Predicate(new Reference[] { ref }, STORE, null), Constants.PROP_CONTENT);
Content content = readResult[0];
InputStream is = getContentAsInputStream(content.getUrl(), helper);
strUrl += "?ticket=" + ticket;
URL url = new URL(strUrl);
URLConnection conn = url.openConnection();
InputStream is = conn.getInputStream();
ByteArrayOutputStream baos = new ByteArrayOutputStream();
int bufferSize = is.available();
byte[] dati = new byte[bufferSize];
int readbyte = 0;
while ((readbyte = is.read(dati, 0, bufferSize)) > -1) {
baos.write(dati, 0, readbyte);
}
baos.close();
is.close();
contentFile = baos.toByteArray();
AuthenticationUtils.endSession();
Hope this helps.
04-01-2009 09:27 AM
Can I close the session after some time (1 or 2 minute) programaticaly?I'd rather leave the session ticket alive instead!
04-08-2009 12:56 AM
04-08-2009 04:05 AM
04-14-2009 12:38 AM
i do it when a user is properly logged out of the whole application usually…and i open a ticket at login time.
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.