Write File/Folder

Operation Name

Write File/Folder

Function Overview

Write a file/folder on DataSpider file system to Google Cloud Storage.

Data Model

The data model of this component is XML type.

Properties

For details on using variables, refer to "Variables".
Basic Settings
Item name Required/Optional Use of variables Description Remarks
Name Required Not Available Enter the name on the script canvas.  
Required Settings
Item name Required/Optional Use of variables Description Remarks
Destination Required Not Available Select Global Resources.
  • [Add]:
    Adds a new global resource.
  • [Edit list]:
    Allows you to edit the global resource settings on the "Edit resource list" screen.
 
Local directory Required Available Enter a directory path of DataSpider File System.

Click the [Browse] button to launch the directory chooser, and select the directory.
Local file/directory name Required Available Select or enter the file/directory on DataSpider files system.
  • Wild cards (asterisk (*) and question mark (?)) can be used.
  • A backslash (/) cannot be included.
Process recursively Optional Not Available For specified local directory, select whether to process file/directory recursively.
  • [Checked]:
    Process file/directory recursively if the specified directory contains a directory in the local directory.
  • [Not checked]: (default)
    Only process files in the specified local directory.
 
Bucket name of the write destination Required Available Select or enter the destination bucket.  
Folder paths of the write destination Required Available Select or enter the folder path on Google Cloud Storage.
  • Specify a folder path as an absolute path on Google Cloud Storage.
Create folder if one does not exist Optional Not Available Select whether to create a folder when the specified folder does not exist.
  • [Checked]: (default)
    Creates a folder when the specified folder does not exist.
  • [Not Checked]:
    Raises an error without creating a folder when the specified folder does not exist.
 
Overwrite when one exists Optional Not Available Select whether to overwrite when a file with the same name exists in the specified folder.
  • [Checked]: (default)
    Overwrites file when a file with the same name exists in the specified folder.
  • [Not Checked]:
    Raises an error without overwriting file when a file with the same name exists in the specified folder.
 
Property Action
Item name Description Remarks
Update the list of bucket names of the write destination Get bucket names in the specified destination and, set them in [Bucket name of the write destination].
  • If [Destination] is edited, or a bucket has been edited on Google Cloud Storage, you can apply the changes by using this property action.
  • Disabled when [Destination] is not specified.
Update the list of folder paths of the write destination Get folder paths in the specified bucket, and set them in [Write destination folder path].
  • If [Bucket name of the write destination] is edited, or a folder path has been edited on Google Cloud Storage, you can apply the changes by using this property action.
  • Disabled when [Destination] or [Bucket name of the write destination] is not specified.
Data Processing Method
Item name Required/Optional Use of variables Description Remarks
Data processing method Required Not Available Select the data processing method.
  • [Apply script settings]: (default)
    Apply mass data processing settings of script property to adapter.
  • [Do not perform mass data processing]:
    Mass data processing is not performed.
  • [Perform mass data processing]:
    Mass data processing is performed.
  • This setting is related to the output processing method of the result data. Therefore, it does not affect the files/folders to be written.
Comment
Item name Required/Optional Use of variables Description Remarks
Comment Optional Not Available You can write a short description of this adapter.
The description will be applied in the specifications.
 

Schema

Input Schema

None

Output Schema

<?xml version="1.0"?>
<bucket name="" status="" >
  <file errorcode="" localpath="" name="" remotepath="" size="" status="" statuscode="" type="" updated=""/>
</bucket>
Element name Attribute name Description Remarks
bucket - Appears in each bucket which is gotten.  
name Outputs name of the bucket acquired.  
status Outputs the status of the gotten bucket.
  • Exist: Status that bucket exists.
  • ErrorBucketNotFound: The specified [Bucket name of the write destination] does not exist on Google Cloud Storage. The specified bucket name may be incorrect.
 
file - Appears in each written file/folder.  
errorcode When an error occurs on Google Cloud Storage, output the API error code specified on Google Cloud Storage.
  • If no error has occurred on Google Cloud Storage, the value is a blank.
  • For more details about API error code defined on Google Cloud Storage, refer to the following Web site: https://cloud.google.com/storage/docs/json_api/v1/status-codes
localpath Output the local path of written file/folder.
  • When status is "RemoteFileNotFound", the value is a blank.
  • When status is "RemoteFileExist" and type is "Folder", the value is a blank.
  • When status is "Uploaded" and type is "Folder", the value is a blank.
  • When status is "Error", the value may be a blank.
name Output the name of written file/folder.
  • When status is "LocalFileNotFound", the value is a blank.
  • When status is "RemoteFileNotFound", the value is a blank.
  • When status is "Error", the value is a blank.
remotepath Output the file path on Google Cloud Storage of each written file/folder.
  • When status is "LocalFileNotFound", the value is a blank.
  • When status is "Error", the value may be a blank.
size When a written file/folder is a file, the file size is output. The unit is bytes.
  • If file/folder is not written correctly, the value is blank.
  • If it is a folder, the value is a blank.
status Output the status of written file/folder.
  • Uploaded: The file/folder was written.
  • LocalFileNotFound: The specified [Local directory] does not exist, or the specified file/directory is not found in [Local file/directory name].
  • RemoteFileNotFound: [Create folder if one does not exist] is [Not checked], the specified folder path does not exist in [Folder paths of the write destination], or a file is specified in [Folder paths of the write destination].
  • RemoteFileExist: A file/folder with the same name specified in [Local file/directory name] exists in [Folder paths of the write destination]. However, when [Overwrite file when one exists] is [Checked], a file is overwritten, and then the status changes to "Uploaded".
  • Error: The file/folder could not be written because an error occurred.
 
statuscode When an error occurs on Google Cloud Storage, output the API status code specified on Google Cloud Storage.
  • If no error has occurred on Google Cloud Storage, the value is a blank.
  • For more details about the API status codes defined on Google Cloud Storage, refer to the following Web site: https://cloud.google.com/storage/docs/json_api/v1/status-codes
type Output the type of written files/folders.
  • File: File
  • Folder: Folder
 
updated Output the latest update date when the written file/folder is a file.
  • If file/folder is not written correctly, the value is blank.
  • If it is a folder, the value is a blank.
  • It is output in the format set in “xmlfw.daterenderingformat” in system properties. When it is not set, it is output in the default format of "yyyy-MM-dd'T'HH:mm:ss.SSSZZ".
    Example: 2007-10-16T13:15:22.738+0900
  • Time zone is the time zone of DataSpiderServer.

Loading Schema in Mapper

Schema is loaded automatically.
For details, refer to "Edit Schema".

Mass Data Processing

Mass data processing is supported.

Transaction

Transaction is not supported.

PSP Usage

PSP cannot be used.

Available Component Variables

Component variable name Description Remarks
count Stores the number of target files/folders.
  • The default value is null.
message_category When an error occurs, the category of the message code corresponding to the error that occurred is stored.
  • The default value is null.
message_code When an error occurs, the code of the message code corresponding to the error that occurred is stored.
  • The default value is null.
message_level When an error occurs, the severity of the message code corresponding to the error that occurred is stored.
  • The default value is null.
error_type When an error occurs, the type of error that occurred is stored.
  • The default value is null.
  • Error type is in the following format:
    Example: "java.io.FileNotFoundException"
  • The contents to be stored may vary depending on the version of DataSpider Servista.
error_message When an error occurs, the message of the error that occurred is stored.
  • The default value is null.
  • The contents to be stored may vary depending on the version of DataSpider Servista.
error_trace When an error occurs, the trace information of the error that occurred is stored.
  • The default value is null.
  • The contents to be stored may vary depending on the version and client applications of DataSpider Servista.

Specification Limits

For more details on specification limits common to each operation, refer to "Google Cloud Storage Adapter Limitations".

Major Exceptions

Exception Name Cause Solution
ResourceNotFoundException
Resource definition is not found. Name:[]
[Destination] is not specified. Specify [Destination].
ResourceNotFoundException
Resource definition is not found. Name:[<Name of global resources>]
Resource definition selected in [Destination] is not found. Check the global resource specified in [Destination].
InvalidPropertyConfigurationException
An incorrect folder path is specified.
The format of the [Folder paths of the write destination] is invalid. Specify slash (/) at the beginning and the end, and specify a folder path that does not contain two slashes (//).
InvalidCredentialException
A service account authentication key is incorrect.
[Service account authentication key] in [Destination] is incorrect. Confirm [Service account authentication key] in [Destination].
CloudStorageServiceException
Failed in the operation for Google Cloud Storage.
Failed in the operation for Google Cloud Storage. Identify the cause of the error from the status code and error code by referring to the error message list page of Google Cloud Storage ( https://cloud.google.com/storage/docs/xml-api/reference-status#standardcodes ), and then resolve the problem.

Notes