Class FileTransferService
- java.lang.Object
-
- jadex.platform.service.filetransfer.FileTransferService
-
- All Implemented Interfaces:
IFileTransferService
public class FileTransferService extends java.lang.Object implements IFileTransferService
Service for deployment files on file system.
-
-
Field Summary
Fields Modifier and Type Field Description protected IExternalAccess
agent
The agent.
-
Constructor Summary
Constructors Constructor Description FileTransferService()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description IFuture<java.lang.Void>
deleteFile(java.lang.String path)
Delete a file.ISubscriptionIntermediateFuture<java.lang.Long>
downloadFile(IOutputConnection con, java.lang.String name)
Download a file.IFuture<FileData[]>
getRoots()
Get the root devices.IFuture<FileData[]>
listDirectory(java.lang.String dir)
List the contents of a directory.static void
main(java.lang.String[] args)
IFuture<java.lang.Void>
openFile(java.lang.String path)
Execute a file.IFuture<java.lang.String>
renameFile(java.lang.String path, java.lang.String name)
Rename a file.ISubscriptionIntermediateFuture<java.lang.Long>
uploadFile(IInputConnection con, java.lang.String path, java.lang.String name)
Put a file.
-
-
-
Field Detail
-
agent
protected IExternalAccess agent
The agent.
-
-
Method Detail
-
uploadFile
public ISubscriptionIntermediateFuture<java.lang.Long> uploadFile(IInputConnection con, java.lang.String path, java.lang.String name)
Put a file.- Specified by:
uploadFile
in interfaceIFileTransferService
- Parameters:
file
- The file data.path
- The target path.- Returns:
- True, when the file has been copied.
-
downloadFile
public ISubscriptionIntermediateFuture<java.lang.Long> downloadFile(IOutputConnection con, java.lang.String name)
Download a file.- Specified by:
downloadFile
in interfaceIFileTransferService
- Parameters:
file
- The file data.- Returns:
- True, when the file has been copied.
-
renameFile
public IFuture<java.lang.String> renameFile(java.lang.String path, java.lang.String name)
Rename a file.- Specified by:
renameFile
in interfaceIFileTransferService
- Parameters:
path
- The target path.name
- The name.- Returns:
- True, if rename was successful.
-
deleteFile
public IFuture<java.lang.Void> deleteFile(java.lang.String path)
Delete a file.- Specified by:
deleteFile
in interfaceIFileTransferService
- Parameters:
path
- The target path.- Returns:
- True, if delete was successful.
-
getRoots
public IFuture<FileData[]> getRoots()
Get the root devices.- Specified by:
getRoots
in interfaceIFileTransferService
- Returns:
- The root device files.
-
openFile
public IFuture<java.lang.Void> openFile(java.lang.String path)
Execute a file.- Specified by:
openFile
in interfaceIFileTransferService
- Parameters:
path
- The filename to execute.
-
listDirectory
public IFuture<FileData[]> listDirectory(java.lang.String dir)
List the contents of a directory.- Specified by:
listDirectory
in interfaceIFileTransferService
- Parameters:
dir
- The directory, null for current directory.- Returns:
- The contained files.
-
main
public static void main(java.lang.String[] args)
-
-