Skip to content
Nuno Aguiar edited this page May 22, 2018 · 1 revision

SMB.SMB

SMB.SMB(aShareURL, aDomain, aUser, aPassword) : SMB

Initializes a SMB object to access the aShareURL on aDomain with aUser and aPassword. Keep in mind to always add a "/" on the end of URLs targeting a folder.

Example:
 var smb = new SMB("smb://a.server/shares/", "mydomain", "user", "...");


SMB.getFile

SMB.getFile(aSourceURL, aTarget) : Number

Will retrieve aSourceURL file to the local filesystem aTarget. Returns the number of characters copied.


SMB.getFileBytes

SMB.getFileBytes(aSourceURL) : JavaByteArray

Returns an array of bytes from the transfer of aSourceURL.


SMB.getInputStream

SMB.getInputStream(aSourceURL) : SmbFileInputStream

Returns a java InputStream to retrieve from aSourceURL.


SMB.getSmbFile

SMB.getSmbFile() : SmbFile

Returns the internal SmbFile object.


SMB.listFiles

SMB.listFiles(aPath) : Map

Returns a map with a files array containing filename, filepath, size, permissions, lastModified, createTime, isDirectory and isFile properties per each entry on aPath. If no aPath is provided it will default to the aShareURL used to instantiate the SMB object.


SMB.putFile

SMB.putFile(aSource, aTargetURL) : Number

Will copy aSource file from the local filesystem to aTargetURL. Returns the number of characters copied.


SMB.writeFileBytes

SMB.writeFileBytes(aTargetURL, arrayOfBytes, append)

Will write an arrayOfBytes to the aTargetURL. The contents will be append if append = true.


SMB.writeFileStream

SMB.writeFileStream(aTargetURL, javaOutputStream, append)

Will write a javaOutputStream to the aTargetURL. The contents will be append if append = true.

Clone this wiki locally