com.ibm.websphere.filetransfer

Interface FileServiceMXBean


  1. public interface FileServiceMXBean
This MBean provides file service operations on the host system on which the server resides.

The ObjectName for this MBean is "WebSphere:feature=restConnector,type=FileService,name=FileService".

All paths are implicitly remote, as the operations performed by this MBean occur on the host which the server resides. All paths are required to be absolute, either explicitly or rooted with a WebSphere variable such as ${wlp.install.dir}.


Nested Class Summary

Modifier and Type Interface and Description
  1. static class
FileServiceMXBean.MetaData
Return type for the getMetaData and getDirectoryEntries methods.

Field Summary

Modifier and Type Field and Description
  1. static
  2. java.lang.String
ATTRIBUTE_NAME_READ_LIST
The name of the attribute representing the list of read locations.
  1. static
  2. java.lang.String
ATTRIBUTE_NAME_WRITE_LIST
The name of the attribute representing the list of write locations.
  1. static
  2. java.lang.String
OBJECT_NAME
A String representing the ObjectName that this MXBean maps to.
  1. static
  2. java.lang.String
REQUEST_OPTIONS_ALL
Option indicating all available keys should be used for the query.
  1. static
  2. java.lang.String
REQUEST_OPTIONS_IS_DIRECTORY
Option indicating that "isDirectory" key should be used for the query.
  1. static
  2. java.lang.String
REQUEST_OPTIONS_LAST_MODIFIED
Option indicating that "lastModified" key should be used for the query.
  1. static
  2. java.lang.String
REQUEST_OPTIONS_READ_ONLY
Option indicating that "isReadOnly" key should be used for the query.
  1. static
  2. java.lang.String
REQUEST_OPTIONS_SIZE
Option indicating that "size" key should be used for the query.

Method Summary

Modifier and Type Method and Description
  1. boolean
createArchive(java.lang.String sourcePath,java.lang.String targetPath)
Create an archive of the given sourcePath.
  1. boolean
expandArchive(java.lang.String sourcePath,java.lang.String targetPath)
Expand the archive at the given sourcePath.
  1. FileServiceMXBean.MetaData[]
getDirectoryEntries(java.lang.String directory,boolean recursive,java.lang.String requestOptions)
List the directory/files for the given path.
  1. FileServiceMXBean.MetaData
getMetaData(java.lang.String path,java.lang.String requestOptions)
Get the metadata pertaining to the specified path.
  1. java.util.List<java.lang.String>
getReadList()
Get the configured list of read-accessible locations on the host where this server resides.
  1. java.util.List<java.lang.String>
getWriteList()
Get the configured list of write-accessible locations on the host where this server resides.

Field Detail

OBJECT_NAME

  1. static final java.lang.String OBJECT_NAME
A String representing the ObjectName that this MXBean maps to.
See Also:

REQUEST_OPTIONS_ALL

  1. static final java.lang.String REQUEST_OPTIONS_ALL
Option indicating all available keys should be used for the query.
See Also:

REQUEST_OPTIONS_IS_DIRECTORY

  1. static final java.lang.String REQUEST_OPTIONS_IS_DIRECTORY
Option indicating that "isDirectory" key should be used for the query.
See Also:

REQUEST_OPTIONS_READ_ONLY

  1. static final java.lang.String REQUEST_OPTIONS_READ_ONLY
Option indicating that "isReadOnly" key should be used for the query.
See Also:

REQUEST_OPTIONS_SIZE

  1. static final java.lang.String REQUEST_OPTIONS_SIZE
Option indicating that "size" key should be used for the query.
See Also:

REQUEST_OPTIONS_LAST_MODIFIED

  1. static final java.lang.String REQUEST_OPTIONS_LAST_MODIFIED
Option indicating that "lastModified" key should be used for the query.
See Also:

ATTRIBUTE_NAME_READ_LIST

  1. static final java.lang.String ATTRIBUTE_NAME_READ_LIST
The name of the attribute representing the list of read locations.
See Also:

ATTRIBUTE_NAME_WRITE_LIST

  1. static final java.lang.String ATTRIBUTE_NAME_WRITE_LIST
The name of the attribute representing the list of write locations.
See Also:

Method Detail

getReadList

  1. java.util.List<java.lang.String> getReadList( )
Get the configured list of read-accessible locations on the host where this server resides. This list is configurable for each server by modifying the server.xml. Each directory to allow for read access can be specified to the <remoteFileAccess> configuration element 'readDir' attribute.

For example:

 <remoteFileAccess>
     <readDir>$ server.output.dir}/payloads</readDir>
 </remoteFileAccess>
 

The default is an empty list.

Returns:
a list of Strings containing the absolute paths which are read-accessible.

getWriteList

  1. java.util.List<java.lang.String> getWriteList( )
Get the configured list of write-accessible locations on the host where this server resides. This list is configurable for each server by modifying the server.xml. Each direcoty to allow for write access can be specified to the <remoteFileAccess> configuration element 'writeDir' attribute.

For example:

 <remoteFileAccess>
     <writeDir>${server.output.dir}/target</writeDir>
 </remoteFileAccess>
 

The default is a list containing 3 entries: ${wlp.install.dir}, ${wlp.user.dir} and ${server.output.dir}.

Returns:
a list of Strings containing the absolute paths which are write-accessible.

getMetaData

  1. FileServiceMXBean.MetaData getMetaData( java.lang.String path,
  2. java.lang.String requestOptions)
Get the metadata pertaining to the specified path. The result object will contain the requested metadata subset as indicated by the requestOptions String value, which should be constructed as a concatenation of the desired values.

For example: to obtain a request that provides only the "size" and "lastModified" metadata values, the user can pass in "st" as the requestOptions field.

Parameters:
path - the absolute path of the file or directory for which to retrieve the metadata
requestOptions - a String representing the concatenation of the requested metadata keys. See REQUEST_OPTIONS_* fields.
Returns:
a CompositeData containing the requested metadata

getDirectoryEntries

  1. FileServiceMXBean.MetaData[] getDirectoryEntries( java.lang.String directory,
  2. boolean recursive,
  3. java.lang.String requestOptions)
List the directory/files for the given path.
Parameters:
directory - the absolute path of the directory to list
recursive - a boolean to specify if the search should be done to all descendant paths
requestOptions - a String representing the concatenation of the requested metadata keys
Returns:
an array of CompositeData, representing the requested metadata for each entry

createArchive

  1. boolean createArchive(java.lang.String sourcePath,
  2. java.lang.String targetPath)
Create an archive of the given sourcePath.

This operation occurs on the file system on which this server resides. Therefore the sourcePath and targetPath are paths on the server's host system.

Parameters:
sourcePath - the absolute path of the entity to archive
targetPath - the absolute path to where resulting archive is to be stored
Returns:
true if archive was successfully created, false otherwise

expandArchive

  1. boolean expandArchive(java.lang.String sourcePath,
  2. java.lang.String targetPath)
Expand the archive at the given sourcePath.

This operation occurs on the file system on which this server resides. Therefore the sourcePath and targetPath are paths on the server's host system.

Parameters:
sourcePath - the absolute path of the archive to be expanded
targetPath - the absolute path to where archive is to be expanded
Returns:
true if archive was successfully expanded, false otherwise