-
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) : 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(aSourceURL, aTarget) : Number
Will retrieve aSourceURL file to the local filesystem aTarget. Returns the number of characters copied.
SMB.getFileBytes(aSourceURL) : JavaByteArray
Returns an array of bytes from the transfer of aSourceURL.
SMB.getInputStream(aSourceURL) : SmbFileInputStream
Returns a java InputStream to retrieve from aSourceURL.
SMB.getSmbFile() : SmbFile
Returns the internal SmbFile object.
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(aSource, aTargetURL) : Number
Will 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.