02-10-2010 04:26 PM
def username = "admin"
def password = "admin"
def filename = "testsdsdsddnew2.pdf"
def savepath = "smb://stastepecm01.myserverdomain.com/Alfresco/DOF/test"
def user = username + ":" + password;
def path = savepath + "/" + filename;
def SmbFileOutputStream sfos
def InputStream is
try
{
NtlmPasswordAuthentication auth = new NtlmPasswordAuthentication(user);
SmbFile sFile = new SmbFile(path, auth);
is = file.getInputStream()
sfos = new SmbFileOutputStream(sFile)
IOUtils.copy(is, sfos)
}
catch
{
throw new PortletException("error saving file to ecm",e)
}
finally
{
IOUtils.closeQuietly(is);
IOUtils.closeQuietly(sfos);
}
04-04-2010 09:56 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.