B4J Programming Press on the image to return to the main documentation page.

SMB

List of types:

SMB
SMBFile

SMB

This library is based on JCIFS library.
It provides access to Microsoft Windows network file system.
See this tutorial.

Events:

DownloadCompleted (Url As String, RemoteFile As String, Success As Boolean)
UploadCompleted (Url As String, RemoteFile As String, Success As Boolean)
DeleteCompleted (Url As String, RemoteFile As String, Success As Boolean)
ListCompleted (Url As String, Success As Boolean, Entries() As SMBFile)

Members:


  DeleteFile (Url As String, RemoteFile As String)

  DownloadFile (Url As String, RemoteFile As String, LocalDir As String, LocalFile As String)

  DownloadFile2 (Url As String, RemoteFile As String, out As java.io.OutputStream, Close As Boolean)

  Initialize (EventName As String)

  Initialize2 (EventName As String, Properties As Map)

  ListFiles (Url As String, FilterPattern As String)

  SetCredentials (Username As String, Password As String, Domain As String)

  UploadFile (LocalDir As String, LocalFile As String, Url As String, RemoteFile As String)

  UploadFile2 (In As java.io.InputStream, Url As String, RemoteFile As String)

Members description:

DeleteFile (Url As String, RemoteFile As String)
Deletes a file or folder (including non-empty folders).
The DeleteCompleted event will be raised when the process completes.
Example: SMB1.DeleteFile("smb://USER-PC/", "1.jpg")
DownloadFile (Url As String, RemoteFile As String, LocalDir As String, LocalFile As String)
Downloads a remote file and stores it in the specified path.
The DownloadCompleted event will be raised when the process completes.
Example: SMB1.DownloadFile("smb://USER-PC/Users/Public/", "1.jpg", File.DirRootExternal, "1.jpg")
DownloadFile2 (Url As String, RemoteFile As String, out As java.io.OutputStream, Close As Boolean)
Similar to DownloadFile. Expects an OutputStream instead of the local file.
Initialize (EventName As String)
Initializes the object.
Initialize2 (EventName As String, Properties As Map)
Initializes the object and sets the specified map of properties as explained on this page:
SMB properties
ListFiles (Url As String, FilterPattern As String)
Lists all files and folders in the given remote path.
FilterPattern - DOS filter pattern. Pass an empty string to list all files and folders.
The ListCompleted event will be raised when the process completes.
Example: SMB1.ListFiles("smb://USER-PC/Users/Public/", "*.jpg")
SetCredentials (Username As String, Password As String, Domain As String)
Sets the credentials that should be used to make the connection.
UploadFile (LocalDir As String, LocalFile As String, Url As String, RemoteFile As String)
Uploads a local file.
The UploadCompleted event will be raised when the process completes.
Example: SMB1.UploadFile(File.DirRootExternal, "1.jpg", "smb://USER-PC/", "1.jpg")
UploadFile2 (In As java.io.InputStream, Url As String, RemoteFile As String)
Similar to UploadFile. Expects an InputStream instead of the local file.

SMBFile

Stores the metadata for a file or folder entry retrieved by calling SMB.ListFiles.

Events:

None

Members:


  Directory As Boolean [read only]

  IsInitialized As Boolean

  LastModified As Long [read only]

  Name As String [read only]

  Parent As String [read only]

  Size As Long [read only]

Members description:

Directory As Boolean [read only]
Returns true if this entry is a directory.
IsInitialized As Boolean
LastModified As Long [read only]
Returns the last modified data.
Example: DateTime.Date(File.LastModified)
Name As String [read only]
Gets the file name.
Parent As String [read only]
Returns the Url of the file parent.
Size As Long [read only]
Returns the file size.
Top