11-18-2010 08:34 AM
BigInteger length = new BigInteger(new Long(IOUtils.toByteArray(is).length).toString());
Map<String, Object> properties = new HashMap<String, Object>();
properties.put(PropertyIds.NAME, documentName);
properties.put(PropertyIds.OBJECT_TYPE_ID, documentObjectType);
String mimeType = URLConnection.getFileNameMap().getContentTypeFor(documentName);
if (StringUtils.isEmpty(mimeType)) {
String extension = getDocumentExtension(documentName);
if (StringUtils.isEmpty(extension)) {
mimeType = "plain/text";
} else {
mimeType = "application/" + extension;
}
}
ContentStream content = new ContentStreamImpl(documentName, length, mimeType, is);
folder.createDocument(properties, content, VersioningState.NONE, null, null, null, getSession().getDefaultContext());
11-18-2010 11:05 AM
11-18-2010 12:33 PM
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.