GW2RegisterImportFile
Ang function na GW2RegisterImportFile ay nagrerehistro ng file path sa interchange file (na ginawa bilang output mula sa mga export processing mode). Ang paggamit ng function na ito ay nag-a-activate ng Import Process Mode para sa session.
- C++
- C#
- Java
- Python
- JavaScript
Buod
Ang function na GW2RegisterImportFile ay nagrerehistro ng file na ang pangalan ay itinuturo ng importFilePath bilang file na dapat nitong i-import. Dapat sumunod ang file sa interchange file format. Ang paggamit ng function na ito ay nag-a-activate ng Import Process Mode para sa session.
#include "glasswall.core2.api.h"
int GW2RegisterImportFile(Session session, const char *importFilePath);
Ibinabalik
Nagbabalik ng integer na GW2_RetStatus enum value. Ang mga negatibong numero ay nagpapahiwatig ng pagkabigo.
Buod
public int RegisterImportFile(
int session,
string importFilePath)
Ibinabalik
Nagbabalik ng integer na GW2_RetStatus enum value. Ang mga negatibong numero ay nagpapahiwatig ng pagkabigo.
Buod
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
Tandaan
Na-update ang mga parameter ng function na GW2RegisterImportFile upang gamitin ang String kapalit ng byte[]. Ang orihinal na function ay deprecated na.
Ibinabalik
Ang function na GW2RegisterImportFile ay nagbabalik ng isang GW2_RetStatus enumeration na kino-convert sa int. Magiging negatibo ang value kung may naganap na error. Ang 0 ay nagpapahiwatig ng tagumpay. Sumangguni sa API Overview/Return types para sa mga detalye.
Maghahagis ng NullPointerException exception kung ang importFilePath ay null o walang laman.
Maghahagis ng GlasswallException exception kung hindi wasto ang session, kung hindi makuha ang importFilePath, o kung hindi ma-convert ang importFilePath sa UTF-8.
Buod
Nirerehistro ang isang .zip file na ii-import para sa ibinigay na session. Ang nabuong file ay gagawin sa panahon ng tawag na run_session ng session.
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.
"""
Ibinabalik
gw_return_object (glasswall.GwReturnObj): Isang instance ng GwReturnObj na may attribute na 'status' na nagsasaad ng resulta ng function call. Kung ang output_file ay None (memory mode), kasama ang 'buffer' at 'buffer_length' na naglalaman ng nilalaman ng file at laki ng file.
Ang status attribute ay isang integer na GW2_RetStatus enum value. Ang mga negatibong numero ay nagpapahiwatig ng failure.
Buod
Nirerehistro ng function na ito ang isang import file path laban sa isang tinukoy na session.
/**
* @param {number} session The ID of the session.
* @param {string} importFilePath The path of the file to be registered.
*/
GW2RegisterImportFile(session, importFilePath)
Ibinabalik
Nagbabalik ng integer na GW2_RetStatus enum value. Ang mga negatibong numero ay nagpapahiwatig ng pagkabigo.