cancel
Showing results for 
Search instead for 
Did you mean: 

using jCIFS to connect to Alfresco share

shikarishambu
Champ in-the-making
Champ in-the-making
I am having issues trying to connect to an alfresco share using jCIFS. I have tried using both the FQDN for the alfresco server and the netbios name (the one that ends with A). In both cases I get bad userid/ password. Please help me resolve the issue


      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);
      }
1 REPLY 1

junieboy
Champ in-the-making
Champ in-the-making
Hi All,

I'm also following up to see if someone already had this work, using the jCIFS api to save files to the Alfresco repository, etc. Thanks in advance.

Regards