if ( !resourceFile.exists() ) {
String message = "File " + fileName + " does not exist.";
throw new Exception( message );
}
ContentStreamImpl contentStream = new ContentStreamImpl();
contentStream.setFileName(fileName + new java.util.Date().getTime());
contentStream.setLength(BigInteger.valueOf(resourceFile.length()));
contentStream.setMimeType(APILocator.getFileAPI().getMimeType(fileName));
contentStream.setStream(new FileInputStream(resourceFile));
PropertiesImpl result = new PropertiesImpl();
result.addProperty(new PropertyIdImpl(PropertyIds.OBJECT_TYPE_ID, BaseTypeId.CMIS_DOCUMENT.value()));
result.addProperty(new PropertyStringImpl(PropertyIds.NAME, fileName));