Read Filesystem

Operation Name

Read Filesystem

Function overview

Reads the data structure of files and directories in the directory.

Data Model

Data model of this type of component is table model type.

Properties

For information about using variables, refer to "variables".
Basic settings
Item name Required/Optional Use of Variables Description Supplement
Name Required Not available Enter the name on the script canvas.  
Required settings
Item name Required/Optional Use of Variables Description Supplement
Directory Required Available Enter the directory to read.


Click [Browse] button to activate the file Selectr and Select the directory.
Data mode Required Not available Select the data mode to extract from [Directory].
  • [Data]: (default)
    Gets structural information in the directory specified file or directory (type, path, name) and the file contents. The contents are gotten as binary format.
  • [Structure]:
    Gets structural information in the directory specified file or directory (type, path, name).
  • If the [Data] is specified, print the contents of files only.
Recursive processing Required Not available Select whether to recursively extracted.
  • [false]: (default)
    Do not get recursively.
  • [true]:
    Get recursively.
 
Data processing method
Item name Required/Optional Use of Variables Description Remarks
Mass data processing Required Not available Select a data processing method.
  • [Use script settings]: (default)
    Apply mass data processing settings of script property to adapter.
  • [Disable]:
    Mass data processing is not performed.
  • [Enable]:
    Mass data processing is performed.
 
Comment
Item name Required/Optional Use of Variables Description Supplement
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"?>
&lt;table&gt;
  &lt;row&gt;
    <column>filetype</column>
    <column>path</column>
    <column>name</column>
    <column>data</column>
  &lt;/row&gt;
  &lt;row&gt;
    :
  &lt;/row&gt;
</table>
Column name Description Remarks
row - Occurs for each file or directory retrieved.  
filetype Represents the type of the file or directory retrieved.
  • [file]:File
  • [directory]:Directory
 
path Returns absolute path of the file or directory retrieved.  
name Enter the file or directory name to get.  
data Outputs the contents of the read file as binary format.
  • Occurs when [Data mode] is set to [Data].
  • Occurs only when it is a file.

Loading schema in Mapper

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

Mass data processing

Mass data processing is supported.

Supports large volume data line by line. You can get a lot of files and directories.

If the retrieved content of the file is large, OutOfMemoryError might occur.In that case you need to ensure DataSpiderServer heap size.

Refer to "Property Reference" for the method of changing the heap size of DataSpiderServer.

PSP Usage

PSP is not supported.

Available Component variables

Variable name Description Remarks
count Get the number of the returned files or directories.
  • The value defaults to null.
message_category Stroes 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 of occured error.
  • The value defaults to null.
message_level Stores the severity of the corresponding message code of the occured error.
  • 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 occured error.
  • 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.

Specification Limits

Main exceptions

Exception name Cause Solution
InvalidPropertyConfigurationException [Directory] is not specified. Specify the [Directory].
FileIsNotDirectoryException Path input in [Directory] is file. Please enter the absolute path of [Directory].
PathIsNotAbsoluteException Path specified in the [Directory] is a relative path. Please enter the absolute path of [Directory].
java.io.FileNotFoundException Path specified in the [Directory] does not exist. Check the path in the [Directory].