AnsweredAssumed Answered

using jCIFS to connect to Alfresco share

Question asked by shikarishambu on Feb 10, 2010
Latest reply on Apr 4, 2010 by junieboy
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);
      }

Outcomes