Read File/Folder

Operation Name

Read File/Folder

Function overview

Acquires file/folder on Google Drive, then write to the directory on DataSpider file system.

Data Model

XML type.

Properties

For information about using variables, refer to "variables".
Basic settings
Item name Required/Optional Use of Variables Description Remarks
Name Required Not available Enter the name to show on the script canvas.  
Required settings
Item name Required/Optional Use of Variables Description Remarks
Destination Required Not available Select Global Resources.
  • [Add]:
    Adds new global resource.
  • [Edit list]:
    Global resource settings can be managed from "Edit Resource list".
 
Drive type Required Not available Select a processing drive.
  • [My drive]: (default)
    Specify the target of processing as "My drive".
  • [Shared drive]:
    Specify the target of processing as "Shared drive".
Shared drive name Required Available Select or enter the Shared drive name.
  • Enabled when [Shared drive] is selected in [Drive type].
Folder path Required Available Enter a Google Drive folder path.
File/folder name Required Available Specify file/folder.
  • In file / folder name, wildcards ("*" and "?") are available.
Local directory Required Available Specify a directory path of DataSpider filesystem.

If [Browse] button is pressed, directory Selectr will launch, then the directory can be selected.
Overwrite Optional Not available Select whether to overwrite when file with the same name exists on the specified local directory.
  • [Checked]: (default)
    Overwrites when file with the same name exists on the specified local directory.
  • [Not Checked]:
    Raises an error without overwriting when file with the same name exists on the specified local directory.
 
Recursive process Optional Not available For a specified folder, select whether to get the file/folder recursively.
  • [Checked]:
    If the specified folder contains the folder, acquires the file/folder recursively.
  • [Not Checked]: (default)
    Retrieves only those files found in the specified folder.
 
Property Action
Item name Description Remarks
Refresh shared drive name list Get the shared drive in the specified destination, and set it in [Shared drive name].
  • Disabled when [Destination] is not specified or [My drive] is selected in [Drive type].
  • If [Destination] is specified/edited, or a drive has been added/edited on Google Drive, you can apply the changes by using this property action.
Refresh list of folder paths Acquires folder path in the specified destination and set to [Folder path].
  • In the following cases, this property action is disabled:
    • [Destination] is not specified
    • [Shared drive name] is not specified
    • A script variable is specified in [Shared drive name]
  • If [Destination] or [Shared drive name] is specified/edited, or a folder has been added/edited on Google Drive, you can apply the changes by using this property action.
Refresh list of item names Acquires file/folder name in the specified folder path and set to [File/folder name].
  • If [Folder path] is specified/edited, or add/edit of folder is performed on Google Drive, the edition can be reflected using this property action.
  • If variable is set to [Folder path], this action will be invalid.
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 reflected in the specifications.
 

Schema

Input Schema

None.

Output Schema

<?xml version="1.0"?>
<server>
  <files drivename="" drivetype="">
    <file etag="" localpath="" md5checksum="" name="" remotepath="" size="" status="" type="" updated="" />
  </files>
</server>
Element name Attribute name Description Remarks
server -    
files -    
drivename Outputs the obtained shared drive name.  
drivetype Outputs the obtained drive type.  
file - Appears in each gotten file/folder.  
etag -
  • Refer to Specification Limits.
localpath Outputs the local path of the retrieved file/folder.
  • When status is "ErrorRemoteFolderNotFound", the value is a blank.
md5checksum Outputs the gotten MD5 checksum of file.
  • Output when file/folder is successfully obtained.
  • In the case of a folder, the value is always a blank.
  • In the case of Google format files, the value is always a blank.
name Outputs the name of the retrieved file/folder.
  • If status is "ErrorRemoteFolderNotFound" then the value is blank.
remotepath Outputs the file path on Google Drive of the retrieved file/folder.  
size Outputs the size of the file/folder retrieved. The unit is byte.
  • Outputs when file / folder is successfully obtained.
  • Outputs "0", in case of folder.
  • For Google format files, "0" is always output.
status Outputs the status of the retrieved file/folder.
  • Exist: Status that file/folder exists.
  • ErrorRemoteDriveNotFound: The specified [Shared drive name] does not exist on Google Drive.
  • ErrorRemoteFolderNotFound: Status that on Google Drive, specified [Folder path] does not exist, or file is specified.
  • ErrorRemoteFileNotFound: Status that on Google Drive, specified file / folder does not exist in specified [Folder path].
  • ErrorLocalFileNotFound: Status that the specified [Local directory] does not exist, or file is specified.
  • ErrorLocalFileExist: Status that [Overwrite] is [Not checked] and files with the same name exist in the specified Local directory.
  • Error: Status that because an error occurred, file/folder could not be read.
 
type Outputs the classification of retrieved files / folders.
  • File: File
  • Folder: Folder
 
updated Outputs the last updated date of the retrieved file/folder.
  • Outputs when file /folder is successfully obtained.
  • Outputs by the format of [xmlfw.daterenderingformat] inside system property.If it has not been set, the default format will be "yyyy-MM-dd'T'HH:mm:ss.SSSZZ "is printed on.Example :2007-10-16T13: 15:22.738 +0900
  • Time zone is the time zone of DataSpiderServer.

Loading schema in Mapper

Schema is loaded automatically.
See "Edit Schema" for any details.

Mass Data Processing

Mass data processing is not supported.
Supports acquiring large files.

PSP Usage

PSP is not supported.

Available component variables

Component variable name Description Remarks
count Returns the count of files/folders acquired.
  • The value defaults to null.
  • The sum of' 'folder_count' and 'file_count'.
folder_count Returns the count of retrieved file.
  • The value defaults to null.
file_count Returns the count of retrieved file.
  • The value defaults to null.
message_category Stores the category to which corresponding message code belongs to, when an error occurs.
  • The value defaults to null.
message_code Stores its corresponding message code, when an error occurs.
  • The value defaults to null.
message_level Stores the severity of the corresponding message code, when an error occurs.
  • The value defaults to null.
error_type Stores the type of the occured error.
  • The value defaults to null.
  • Error is represented in the format depicted below.
    Example:java.io.FileNotFoundException
  • The message may vary depending on DataSpider Servista version.
error_message Stores the error message for the error occurred.
  • The value defaults to null.
  • The message may vary depending on DataSpider Servista version.
error_trace Stores stack trace of the occurred error.
  • The value defaults to null.
  • The message may vary depending on DataSpider Servista version or the client application used.

File Conversion from Google Format

Specification Limits

Main exceptions

Exception name Causes Solution
ResourceNotFoundException
Resource definition could not be found.Name: []
[Destination] is not specified. Specify [Destination].
ResourceNotFoundException
Resource definition could not be found.Name: [<name of Global Resources>]
Resource definition selected in [Destination] is not found. Check the global resource specified in [Destination].
InvalidPropertyConfigurationException
<Property name> is not specified.
[<Property name>] is not specified. Specify the [<Property name>].

Notes