-
Notifications
You must be signed in to change notification settings - Fork 6
smb
- SMB.SMB
- SMB.getFile
- SMB.getFileBytes
- SMB.getInputStream
- SMB.getSmbFile
- SMB.listFiles
- SMB.putFile
- SMB.writeFileBytes
- SMB.writeFileStream
SMB.SMB(aShareURL, aDomain, aUser, aPassword) : SMBInitializes 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(aSourceURL, aTarget) : NumberWill retrieve aSourceURL file to the local filesystem aTarget. Returns the number of characters copied.
SMB.getFileBytes(aSourceURL) : JavaByteArrayReturns an array of bytes from the transfer of aSourceURL.
SMB.getInputStream(aSourceURL) : SmbFileInputStreamReturns a java InputStream to retrieve from aSourceURL.
SMB.getSmbFile() : SmbFileReturns the internal SmbFile object.
SMB.listFiles(aPath) : MapReturns 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(aSource, aTargetURL) : NumberWill copy aSource file from the local filesystem to aTargetURL. Returns the number of characters copied.
SMB.writeFileBytes(aTargetURL, arrayOfBytes, append)Will write an arrayOfBytes to the aTargetURL. The contents will be append if append = true.
SMB.writeFileStream(aTargetURL, javaOutputStream, append)Will write a javaOutputStream to the aTargetURL. The contents will be append if append = true.