File Explorer API
Infor Public Sector includes an API (
Hansen.Core.FileManagement.FileExplorer
) that you can use to work
with directories and files on the server programmatically. For example, you can use this API
to manage your agency files in a multi-tenant environment, where you don't have direct access
to the server.This table describes the methods that are available in the File Explorer API. All directory paths are relative to the Root directory in the File Explorer.
Method | Description | Parameters |
---|---|---|
AppendAllText | Opens the specified file and appends the specified text. |
|
CopyDirectory | Copies the specified directory and all its contents to the specified destination. (Not supported in a multi-tenant environment.) |
|
CopyFile | Copies the specified file to the specified destination. |
|
CreateDirectory | Adds a directory. |
|
DeleteDirectory | Deletes the specified directory and all of its contents. |
|
DeleteFile | Deletes the specified file. |
|
DirectoryExists | Returns True if the specified directory exists. |
|
FileExists | Returns True if the specified file exists. |
|
GetConfiguredDirectories | Gets a list of directories from the FileManagement configuration.
Returns a collection of IpsDirectoryInfo objects. |
None |
GetDirectories | Gets all directories under the Root directory. Returns a collection of
IpsDirectoryInfo objects. |
None |
GetDirectories | Gets the directories within the specified directory. Returns a
collection of IpsDirectoryInfo objects. |
|
GetDirectoryInfo | Gets information about the specified directory. Returns an
IpsDirectoryInfo object. |
|
GetFileInfo | Gets information about the specified file. Returns an
IpsFileInfo object. |
|
GetFiles | Gets the files within the specified directory. Returns a
collection of IpsFileInfo objects. |
|
GetParentDirectory | Gets the parent directory of the specified directory. Returns an
IpsDirectoryInfo object. |
|
HasSubDirectories | Returns True if the specified directory has
subdirectories. |
|
IsDirectoryReadable | Returns True if the specified directory can be read
from. |
|
IsDirectoryWritable | Returns True if the specified directory can be written
to. |
|
IsFileReadable | Returns True if the specified file can be read from. |
|
IsFileWritable | Returns True if the specified file can be written to. |
|
MoveDirectory | Moves the specified directory and all of its contents. (Not supported in a multi-tenant environment.) |
|
MoveFile | Moves the specified file. (Not supported in a multi-tenant environment.) |
|
OpenRead | Reads the specified file to a stream. |
|
OpenWrite | Opens the specified file or creates a new one with write access. |
|
ReadAllBytes | Returns a byte array with the contents of the specified file. |
|
ReadAllText | Returns a string with the contents of the specified file. |
|
RenameDirectory | Renames the specified directory. (Not supported in a multi-tenant environment.) |
|
RenameFile | Renames the specified file. |
|
WriteAllBytes | Writes the specified byte array to a file. If the file already exists it will be overwritten. |
|
WriteAllText | Writes the specified text to a file. If the file already exists it will be overwritten. |
|
IpsDirectoryInfo
The Hansen.Core.FileManagement.IpsDirectoryInfo
object represents a
directory on the server. This table describes the properties of this object:
Property | Description |
---|---|
ConfiguredName (String) | Name of the directory as specified in the FileManagement configuration. |
Created (System.DateTime) | Date and time the directory was created. |
FullName (String) | Fully qualified name of the directory. |
LastModified (System.DateTime) | Date and time the directory was last modified. |
Name (String) | Name of the directory. |
VirtualFullName (String) | Fully qualified virtual name of the directory. |
VirtualName (String) | Virtual name of the directory. |
IpsFileInfo
The Hansen.Core.FileManagement.IpsFileInfo
object represents a file on the
server. This table describes the properties of this object:
Property | Description |
---|---|
Created (System.DateTime) | Date and time the file was created. |
Directory (Hansen.Core.FileManagement.IpsDirectoryInfo) | Directory where the file is located. |
Extension (String) | File extension. |
FullName (String) | Fully qualified name of the file. (Not available in a multi-tenant environment.) |
IsStandardFileSystemProvider (Boolean) | Indicates whether the file uses a standard file system provider. |
IsVirtual (Boolean) | Indicates whether this is a virtual file, such as a file in a database file management system. |
LastModified (System.DateTime) | Date and time the file was last modified. |
Length (Long) | Size of the file in bytes. |
Name (String) | Name of the file. |
VirtualFullName (String) | Fully qualified virtual name of the file. |
VirtualName (String) | Virtual name of the file. |