+

Search Tips   |   Advanced Search

File transfer

The restConnector-1.0 feature includes the FileTransfer and FileService MBeans. The FileTransfer MBean supports delete, upload, and download operations to and from a running Liberty server. The FileService MBean provides access to directory lists and file metadata, and it also provides archive operations such as create and expand.

The FileTransfer and FileService MBeans are useful for carrying out remote operations on a Liberty profile, such as updating the configuration or installing an application. A configuration update can be performed remotely by uploading an updated server.xml file for the target Liberty server. An application can be installed by uploading both the application archive and an updated server.xml file or simply by uploading the application archive to the monitored dropins folder.

The FileTransfer MBean includes configurable read and write lists so that we can control the directories that can be read or written when using the FileTransfer MBean.

See the section on the FileTransfer MBean in List of provided MBeans for information on how to configure the restConnector-1.0 feature and control the FileTransfer MBean read and write lists.

The uploadFile method from FileTransfer contains a boolean called "expandOnCompletion" that allows a user to upload and expand the archive with a single MBean invocation. A directory is created with the same name as the archive on the target path and the FileService MBean is automatically invoked to expand the archive.

Example: A call to uploadFile with parameters {"C:/temp/myArchive.zip", "${server.output.dir}/myArchive.zip", true} will result in a myArchive.zip directory under ${server.output.dir} containing the extracted contents of the archive being created.


Parent topic: Set up the Liberty profile

  • Collective architecture
    File transfer in a Liberty collective
    Collective security
    Liberty collective troubleshooting
    Set the default host name of a Liberty server
    Configure a Liberty collective
    Register host computers with a Liberty collective
    Set the JAVA_HOME variable for Liberty collective members
    Configure Liberty collective replica sets
    Example of setting up a JMX routing environment
    List of provided MBeans
    Overriding Liberty server host information