The GW2RegisterImportFile function registers a file path to the interchange file (produced as an output from export processing modes). Using this function activates the Import Process Mode for the session.
Synopsis
The GW2RegisterImportFile function registers the file whose name is pointed to by importFilePath as the file it should import. The file must conform to the interchange file format. Using this function activates the Import Process Mode for the session.
#include "glasswall.core2.api.h"
int GW2RegisterImportFile(Session session, const char *importFilePath);
Returns
Returns an integer GW2_RetStatus
enum value. Negative numbers indicate a failure.
Synopsis
public int RegisterImportFile(
int session,
string importFilePath)
Returns
Returns an integer GW2_RetStatus
enum value. Negative numbers indicate a failure.
Synopsis
import com.glasswall.core2javabridge.*;
public int GW2RegisterImportFile(int session, String importFilePath) throws GlasswallException, NullPointerException
(deprecated)
public int GW2RegisterImportFile(int session, byte[] importFilePath) throws GlasswallException, NullPointerException
Note:
The GW2RegisterImportFile function parameters have been updated to use String
in place of byte[]
. The original function has been deprecated.
Returns
The GW2RegisterImportFile function returns a GW2_RetStatus enumeration converted to int
. The value will be negative if an error occurred. 0
indicates success.
Please refer to API Overview for Return Types and their details.
A NullPointerException exception will be thrown if importFilePath
is null or empty.
A GlasswallException exception will be thrown if session
is invalid, if the importFilePath
could not be retrieved, or if the importFilePath
could not be converted to UTF-8.
Synopsis
Registers a .zip file to be imported for the given session. The constructed file will be created during the session's run_session call.
def register_import(self, session: int, input_file: Union[str, bytes, bytearray, io.BytesIO]):
""" Registers a .zip file to be imported for the given session. The constructed file will be created during the session's run_session call.
Args:
session (int): The session integer.
input_file (Union[str, bytes, bytearray, io.BytesIO]): The input import file path or bytes.
Returns:
gw_return_object (glasswall.GwReturnObj): A GwReturnObj instance with the attribute 'status' indicating the result of the function call. If output_file is None (memory mode), 'buffer', and 'buffer_length' are included containing the file content and file size.
"""
Returns
gw_return_object (glasswall.GwReturnObj): A GwReturnObj instance with the attribute 'status' indicating the result of the function call. If output_file is None (memory mode), 'buffer', and 'buffer_length' are included containing the file content and file size.
Synopsis
This function registers an import file path against a specified session.
/**
* @param {number} session The ID of the session.
* @param {string} importFilePath The path of the file to be registered.
*/
GW2RegisterImportFile(session, importFilePath)
Returns
Returns an integer GW2_RetStatus
enum value. Negative numbers indicate a failure.