GW2RegisterImportFile
GW2RegisterImportFile फ़ंक्शन interchange file के file path को register करता है (जो export processing modes से output के रूप में उत्पन्न होती है)। इस फ़ंक्शन का उपयोग करने से session के लिए Import Process Mode सक्रिय हो जाता है।
- C++
- C#
- Java
- Python
- JavaScript
सारांश
GW2RegisterImportFile फ़ंक्शन उस file को, जिसका नाम importFilePath द्वारा point किया गया है, import की जाने वाली file के रूप में register करता है। file को interchange file format के अनुरूप होना चाहिए। इस फ़ंक्शन का उपयोग करने से session के लिए Import Process Mode सक्रिय हो जाता है।
#include "glasswall.core2.api.h"
int GW2RegisterImportFile(Session session, const char *importFilePath);
रिटर्न
एक पूर्णांक GW2_RetStatus enum मान लौटाता है। नकारात्मक संख्याएँ विफलता को दर्शाती हैं।
सारांश
public int RegisterImportFile(
int session,
string importFilePath)
रिटर्न
एक पूर्णांक GW2_RetStatus enum मान लौटाता है। नकारात्मक संख्याएँ विफलता को दर्शाती हैं।
सारांश
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
नोट
The GW2RegisterImportFile function parameters have been updated to use String in place of byte[]. The original function has been deprecated.
रिटर्न
GW2RegisterImportFile फ़ंक्शन GW2_RetStatus enumeration को int में परिवर्तित करके लौटाता है। यदि कोई त्रुटि हुई हो, तो मान नकारात्मक होगा। 0 सफलता को दर्शाता है। विवरण के लिए API Overview/Return types देखें।
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.
सारांश
दिए गए session के लिए import की जाने वाली .zip file को register करता है। निर्मित file session के 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.
"""
रिटर्न
gw_return_object (glasswall.GwReturnObj): 'status' attribute के साथ एक GwReturnObj instance, जो function call के परिणाम को दर्शाता है। यदि output_file None है (memory mode), तो file content और file size को शामिल करते हुए 'buffer' और 'buffer_length' शामिल किए जाते हैं।
status attribute एक integer GW2_RetStatus enum value है। Negative numbers विफलता को दर्शाते हैं।
सारांश
यह function किसी निर्दिष्ट session के लिए एक import file path को register करता है।
/**
* @param {number} session The ID of the session.
* @param {string} importFilePath The path of the file to be registered.
*/
GW2RegisterImportFile(session, importFilePath)
रिटर्न
एक पूर्णांक GW2_RetStatus enum मान लौटाता है। नकारात्मक संख्याएँ विफलता को दर्शाती हैं।