blob: f4f385d41356b8b3f0483705f956a2ec63afb1e0 [file] [log] [blame]
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en" dir="ltr">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="keywords" content="SMILA/Documentation/Importing/Crawler/File,SMILA/Documentation/Importing/Concept,SMILA/Documentation/Importing/SimpleCompoundExtractorService,SMILA/Documentation/TaskGenerators" />
<link rel="shortcut icon" href="http://wiki.eclipse.org/SMILA/Documentation/Importing/Crawler/favicon.ico" />
<link rel="search" type="application/opensearchdescription+xml" href="http://wiki.eclipse.org/opensearch_desc.php" title="Eclipsepedia (English)" />
<link rel="alternate" type="application/rss+xml" title="Eclipsepedia RSS Feed" href="http://wiki.eclipse.org/index.php?title=Special:Recentchanges&amp;feed=rss" />
<link rel="alternate" type="application/atom+xml" title="Eclipsepedia Atom Feed" href="http://wiki.eclipse.org/index.php?title=Special:Recentchanges&amp;feed=atom" />
<title>SMILA/Documentation/Importing/Crawler/File - Eclipsepedia</title>
<style type="text/css" media="screen,projection">/*<![CDATA[*/ @import "http://wiki.eclipse.org/skins/eclipsenova/novaWide.css?116"; /*]]>*/</style>
<link rel="stylesheet" type="text/css" media="print" href="http://wiki.eclipse.org/skins/eclipsenova/eclipsenovaPrint.css?116" />
<link rel="stylesheet" type="text/css" media="handheld" href="http://wiki.eclipse.org/skins/eclipsenova/handheld.css?116" />
<link rel="stylesheet" type="text/css" href="http://wiki.eclipse.org/skins/eclipsenova/Nova/css/header.css" media="screen" />
<link rel="stylesheet" type="text/css" href="http://wiki.eclipse.org/skins/eclipsenova/tabs.css" media="screen" />
<link rel="stylesheet" type="text/css" href="http://wiki.eclipse.org/skins/eclipsenova/Nova/css/visual.css" media="screen" />
<link rel="stylesheet" type="text/css" href="http://wiki.eclipse.org/skins/eclipsenova/Nova/css/layout.css" media="screen" />
<link rel="stylesheet" type="text/css" href="http://wiki.eclipse.org/skins/eclipsenova/Nova/css/footer.css" media="screen" />
<!--[if IE]><link rel="stylesheet" type="text/css" href="/skins/eclipsenova/IEpngfix.css" media="screen" /><![endif]-->
<!--[if lt IE 5.5000]><style type="text/css">@import "/skins/eclipsenova/IE50Fixes.css?116";</style> <![endif]-->
<!--[if IE 5.5000]><style type="text/css">@import "/skins/eclipsenova/IE55Fixes.css?116";</style><![endif]-->
<!--[if IE 6]><style type="text/css">@import "/skins/eclipsenova/IE60Fixes.css?116";</style><![endif]-->
<!--[if IE 7]><style type="text/css">@import "/skins/eclipsenova/IE70Fixes.css?116";</style><![endif]-->
<!--[if lt IE 7]><script type="text/javascript" src="/skins/common/IEFixes.js?116"></script>
<meta http-equiv="imagetoolbar" content="no" /><![endif]-->
<script type= "text/javascript">/*<![CDATA[*/
var skin = "eclipsenova";
var stylepath = "/skins";
var wgArticlePath = "/$1";
var wgScriptPath = "";
var wgScript = "/index.php";
var wgServer = "http://wiki.eclipse.org";
var wgCanonicalNamespace = "";
var wgCanonicalSpecialPageName = false;
var wgNamespaceNumber = 0;
var wgPageName = "SMILA/Documentation/Importing/Crawler/File";
var wgTitle = "SMILA/Documentation/Importing/Crawler/File";
var wgAction = "view";
var wgRestrictionEdit = [];
var wgRestrictionMove = [];
var wgArticleId = "34874";
var wgIsArticle = true;
var wgUserName = null;
var wgUserGroups = null;
var wgUserLanguage = "en";
var wgContentLanguage = "en";
var wgBreakFrames = false;
var wgCurRevisionId = "328038";
var wgVersion = "1.12.0";
var wgEnableAPI = true;
var wgEnableWriteAPI = false;
/*]]>*/</script>
<script type="text/javascript" src="http://wiki.eclipse.org/skins/common/wikibits.js?116"><!-- wikibits js --></script>
<!-- Performance mods similar to those for bug 166401 -->
<script type="text/javascript" src="http://wiki.eclipse.org/index.php?title=-&amp;action=raw&amp;gen=js&amp;useskin=eclipsenova"><!-- site js --></script>
<!-- Head Scripts -->
<script type="text/javascript" src="http://wiki.eclipse.org/skins/common/ajax.js?116"></script>
<link rel="stylesheet" type="text/css" href="File.html" /> </head>
<body class="mediawiki ns-0 ltr page-SMILA_Documentation_Importing_Crawler_File">
<div id="globalWrapper">
<div id="column-one">
<!-- Eclipse Additions for the Top Nav start here M. Ward-->
<div id="header">
<div id="header-graphic">
<img src="http://wiki.eclipse.org/skins/eclipsenova/eclipse.png" alt="Eclipse Wiki">
</div>
<!-- Pulled 101409 Mward -->
<div class="portlet" id="p-personal">
<div class="pBody">
<ul>
<li id="pt-login"><a href="http://wiki.eclipse.org/index.php?title=Special:Userlogin&amp;returnto=SMILA/Documentation/Importing/Crawler/File">Log in</a></li>
</ul>
</div>
</div>
<div id="header-icons">
<div id="sites">
<ul id="sitesUL">
<li><a href="http://www.eclipse.org"><img src="http://dev.eclipse.org/custom_icons/eclipseIcon.png" width="28" height="28" alt="Eclipse Foundation" title="Eclipse Foundation" /><div>Eclipse Foundation</div></a></li>
<li><a href="http://marketplace.eclipse.org"><img src="http://dev.eclipse.org/custom_icons/marketplace.png" width="28" height="28" alt="Eclipse Marketplace" title="Eclipse Marketplace" /><div>Eclipse Marketplace</div></a></li>
<li><a href="https://bugs.eclipse.org/bugs"><img src="http://dev.eclipse.org/custom_icons/system-search-bw.png" width="28" height="28" alt="Bugzilla" title="Bugzilla" /><div>Bugzilla</div></a></li>
<li><a href="http://live.eclipse.org"><img src="http://dev.eclipse.org/custom_icons/audio-input-microphone-bw.png" width="28" height="28" alt="Live" title="Live" /><div>Eclipse Live</div></a></li>
<li><a href="http://planeteclipse.org"><img src="http://dev.eclipse.org/large_icons/devices/audio-card.png" width="28" height="28" alt="PlanetEclipse" title="Planet" /><div>Planet Eclipse</div></a></li>
<li><a href="http://portal.eclipse.org"><img src="http://dev.eclipse.org/custom_icons/preferences-system-network-proxy-bw.png" width="28" height="28" alt="Portal" title="Portal" /><div>My Foundation Portal</div></a></li>
</ul>
</div>
</div>
</div>
<!-- NEW HEADER STUFF HERE -->
<div id="header-menu">
<div id="header-nav">
<ul> <li><a class="first_one" href="http://wiki.eclipse.org/" target="_self">Home</a></li> <li><a href="http://www.eclipse.org/downloads/" target="_self">Downloads</a></li>
<li><a href="http://www.eclipse.org/users/" target="_self">Users</a></li>
<li><a href="http://www.eclipse.org/membership/" target="_self">Members</a></li>
<li><a href="http://wiki.eclipse.org/index.php/Development_Resources" target="_self">Committers</a></li>
<li><a href="http://www.eclipse.org/resources/" target="_self">Resources</a></li>
<li><a href="http://www.eclipse.org/projects/" target="_self">Projects</a></li>
<li><a href="http://www.eclipse.org/org/" target="_self">About Us</a></li>
</ul>
</div>
<div id="header-utils">
<!-- moved the search window here -->
<form action="http://wiki.eclipse.org/Special:Search" >
<input class="input" name="search" type="text" accesskey="f" value="" />
<input type='submit' onclick="this.submit();" name="go" id="searchGoButton" class="button" title="Go to a page with this exact name if one exists" value="Go" />&nbsp;
<input type='submit' onclick="this.submit();" name="fulltext" class="button" id="mw-searchButton" title="Search Eclipsepedia for this text" value="Search" />
</form>
</div>
</div>
<!-- Eclipse Additions for the Header stop here -->
<!-- Additions and mods for leftside nav Start here -->
<!--Started nav rip here-->
<!-- these are the nav controls main page, changes etc -->
<div id="novaContent" class="faux">
<div id="leftcol">
<ul id="leftnav">
<!-- these are the page controls, edit history etc -->
<li class="separator"><a class="separator">Navigation &#160;&#160;</li>
<li id="n-mainpage"><a href="http://wiki.eclipse.org/Main_Page">Main Page</a></li>
<li id="n-portal"><a href="http://wiki.eclipse.org/Eclipsepedia:Community_Portal">Community portal</a></li>
<li id="n-currentevents"><a href="http://wiki.eclipse.org/Eclipsepedia:Current_events">Current events</a></li>
<li id="n-recentchanges"><a href="http://wiki.eclipse.org/Special:Recentchanges">Recent changes</a></li>
<li id="n-randompage"><a href="http://wiki.eclipse.org/Special:Random">Random page</a></li>
<li id="n-help"><a href="http://wiki.eclipse.org/Help:Contents">Help</a></li>
<li class="separator"><a class="separator">Toolbox &#160;&#160;</a></li>
<li id="t-whatlinkshere"><a href="http://wiki.eclipse.org/Special:Whatlinkshere/SMILA/Documentation/Importing/Crawler/File">What links here</a></li>
<li id="t-recentchangeslinked"><a href="http://wiki.eclipse.org/Special:Recentchangeslinked/SMILA/Documentation/Importing/Crawler/File">Related changes</a></li>
<!-- This is the toolbox section -->
<li id="t-upload"><a href="http://wiki.eclipse.org/Special:Upload">Upload file</a></li>
<li id="t-specialpages"><a href="http://wiki.eclipse.org/Special:Specialpages">Special pages</a></li>
<li id="t-print"><a href="http://wiki.eclipse.org/index.php?title=SMILA/Documentation/Importing/Crawler/File&amp;printable=yes">Printable version</a></li> <li id="t-permalink"><a href="http://wiki.eclipse.org/index.php?title=SMILA/Documentation/Importing/Crawler/File&amp;oldid=328038">Permanent link</a></li> </ul>
</div>
<!-- Additions and mods for leftside nav End here -->
<div id="column-content">
<div id="content">
<a name="top" id="top"></a>
<div id="tabs">
<ul class="primary">
<li class="active"><a href="File.html"><span class="tab">Page</span></a></li>
<li><a href="http://wiki.eclipse.org/index.php?title=Talk:SMILA/Documentation/Importing/Crawler/File&amp;action=edit"><span class="tab">Discussion</span></a></li>
<li><a href="http://wiki.eclipse.org/index.php?title=SMILA/Documentation/Importing/Crawler/File&amp;action=edit"><span class="tab">View source</span></a></li>
<li><a href="http://wiki.eclipse.org/index.php?title=SMILA/Documentation/Importing/Crawler/File&amp;action=history"><span class="tab">History</span></a></li>
<li><a href="http://wiki.eclipse.org/index.php?title=Special:Userlogin&amp;returnto=SMILA/Documentation/Importing/Crawler/File"><span class="tab">Edit</span></a></li>
</ul>
</div>
<script type="text/javascript"> if (window.isMSIE55) fixalpha(); </script>
<h1 class="firstHeading">SMILA/Documentation/Importing/Crawler/File</h1>
<div id="bodyContent">
<h3 id="siteSub">From Eclipsepedia</h3>
<div id="contentSub"><span class="subpages">&lt; <a href="../../../../SMILA.html" title="SMILA">SMILA</a> | <a href="../../../Documentation.1.html" title="SMILA/Documentation">Documentation</a></span></div>
<div id="jump-to-nav">Jump to: <a href="File.html#column-one">navigation</a>, <a href="File.html#searchInput">search</a></div> <!-- start content -->
<p>File Crawler, File Fetcher and File Extractor worker are used for importing files from a file system. For a big picture and the worker's interaction have a look at the <a href="../Concept.html" title="SMILA/Documentation/Importing/Concept"> Importing Concept</a>.
</p>
<table id="toc" class="toc" summary="Contents"><tr><td><div id="toctitle"><h2>Contents</h2></div>
<ul>
<li class="toclevel-1"><a href="File.html#File_Crawler"><span class="tocnumber">1</span> <span class="toctext">File Crawler</span></a>
<ul>
<li class="toclevel-2"><a href="File.html#Configuration"><span class="tocnumber">1.1</span> <span class="toctext">Configuration</span></a></li>
<li class="toclevel-2"><a href="File.html#Processing"><span class="tocnumber">1.2</span> <span class="toctext">Processing</span></a></li>
</ul>
</li>
<li class="toclevel-1"><a href="File.html#File_Fetcher"><span class="tocnumber">2</span> <span class="toctext">File Fetcher</span></a>
<ul>
<li class="toclevel-2"><a href="File.html#Configuration_2"><span class="tocnumber">2.1</span> <span class="toctext">Configuration</span></a></li>
</ul>
</li>
<li class="toclevel-1"><a href="File.html#File_Extractor_Worker"><span class="tocnumber">3</span> <span class="toctext">File Extractor Worker</span></a>
<ul>
<li class="toclevel-2"><a href="File.html#Configuration_3"><span class="tocnumber">3.1</span> <span class="toctext">Configuration</span></a></li>
<li class="toclevel-2"><a href="File.html#Processing_2"><span class="tocnumber">3.2</span> <span class="toctext">Processing</span></a></li>
</ul>
</li>
<li class="toclevel-1"><a href="File.html#Sample_file_crawl_job"><span class="tocnumber">4</span> <span class="toctext">Sample file crawl job</span></a></li>
</ul>
</li>
</ul>
</td></tr></table><script type="text/javascript"> if (window.showTocToggle) { var tocShowText = "show"; var tocHideText = "hide"; showTocToggle(); } </script>
<a name="File_Crawler"></a><h3> <span class="mw-headline"> File Crawler </span></h3>
<p>The File Crawler crawls files from a root folder and the subdirectories below.
</p>
<a name="Configuration"></a><h5> <span class="mw-headline"> Configuration </span></h5>
<p>The File Crawler worker is usually the first worker in a workflow and the job is started in <tt>runOnce</tt> mode.
</p>
<ul><li> Worker name: <tt>fileCrawler</tt>
</li><li> Parameters:
<ul><li> <tt>dataSource</tt>: <i>(req.)</i> value for attribute <tt>_source</tt>, needed e.g. by the delta service
</li><li> <tt>rootFolder</tt>: <i>(req.)</i> crawl starting point
</li><li> <tt>filters</tt> <i>(opt.)</i> filters with conditions to in- or exclude files and folders from import
<ul><li> <tt>maxFileSize</tt>: maximum file size, files that are bigger are filtered out
</li><li> <tt>maxFolderDepth</tt>: starting from the root folder, this is the maximum depth to crawl into subdirectories. <i>(Hint: Folder structures in compounds are not taken into account here)</i>
</li><li> <tt>followSymbolicLinks</tt>: whether to follow symbolic links to files/folders or not
</li><li> <tt>filePatterns</tt>: regex patterns for filtering crawled files on the basis of their file name
<ul><li> <tt>include</tt>: if include patterns are specified, at least one of them must match the file name. If no include patterns are specified, this is handled as if all file names are included.
</li><li> <tt>exclude</tt>: if at least one exclude pattern matches the file name, the crawled file is filtered out
</li><li> <b>(Hint: the patterns need to use forward slashes as directory seperators, even if your file system uses backslashes as folder delimiters)</b>
</li></ul>
</li><li> <tt>folderPatterns</tt>: regex patterns for filtering crawled folders and files on the basis of their complete folder path. <b>(Hint: Contrary to the file patterns a folder pattern must match the complete path, it doesn't work if it just matches the folder name!)</b>
<ul><li> <tt>include</tt>: Only relevant for crawled files: If include patterns are specified, at least one of them must match the file path. If no include patterns are specified, this is handled as if all file paths are included.
</li><li> <tt>exclude</tt>: Only relevant for crawled folders: If at least one exclude pattern matches the folder name, the folder (and its subdirectories) will not be imported.
</li><li> <b>(Hint: the patterns need to use forward slashes as directory seperators, even if your file system uses backslashes as folder delimiters)</b>
</li></ul>
</li></ul>
</li><li> <tt>mapping</tt> <i>(req.)</i> specifies how to map file properties to record attributes
<ul><li> <tt>filePath</tt> <i>(opt.)</i> mapping attribute for the complete file path <i>(Hint: required for standard import workflow because File Fetcher and File Extractor worker need this, see below)</i>
</li><li> <tt>fileFolder</tt> <i>(opt.)</i> mapping attribute for the file folder (complete path without file name)
</li><li> <tt>fileName</tt> <i>(opt.)</i> mapping attribute for the file name
</li><li> <tt>fileExtension</tt> <i>(opt.)</i> mapping attribute for the file extension
</li><li> <tt>fileSize</tt> <i>(opt.)</i> mapping attribute for the file size (in bytes)
</li><li> <tt>fileLastModified</tt> <i>(opt.)</i> mapping attribute for the file's last modified date
</li></ul>
</li><li> parameters to control size of output bulks, see below for details
<ul><li> <tt>maxFilesPerBulk</tt> <i>(opt.)</i> maximum number of files in one bulk. (default: 1000)
</li><li> <tt>minFilesPerBulk</tt> <i>(opt.)</i> minimum number of files in one bulk. (default: 0)
</li><li> <tt>directoriesPerBulk</tt> <i>(opt.)</i> number of directories written to one bulk for follow-up crawl tasks. (default: 1)
</li></ul>
</li></ul>
</li><li> Task generator: <tt><a href="../../TaskGenerators.html#RunOnceTriggerTaskGenerator" title="SMILA/Documentation/TaskGenerators">runOnceTrigger</a></tt>
</li><li> Input slots:
<ul><li> <tt>directoriesToCrawl</tt>
</li></ul>
</li><li> Output slots:
<ul><li> <tt>directoriesToCrawl</tt>
</li><li> <tt>filesToCrawl</tt>
</li></ul>
</li></ul>
<a name="Processing"></a><h5> <span class="mw-headline"> Processing </span></h5>
<p>The File Crawler starts crawling in the <tt>rootFolder</tt>. It produces one record for each subdirectory in the bucket connected to <tt>directoriesToCrawl</tt> and one record per file in the bucket connected to <tt>filesToCrawl</tt>. The bucket in slot <tt>directoriesToCrawl</tt> should be connected to the input slot of the File Crawler so that the subdirectories are crawled in followup tasks. The resulting records do not yet contain the file content but only metadata attributes configured in the <tt>mapping</tt>.
</p><p>The directory and file records are collected in bulks, whose size can be configured via the parameters <tt>maxFilesPerBulk</tt>, <tt>minFilesPerBulk</tt> and <tt>directoriesPerBulk</tt>:
</p>
<ul><li> <tt>maxFilesPerBulk</tt> has the same effect in any of the following cases:
<ul><li> <i>not configured:</i> a new <tt>filesToCrawl</tt> bulk is started each 1000 files.
</li><li> <i>configured:</i> a new <tt>filesToCrawl</tt> bulk is started when the configured value is reached.
</li></ul>
</li><li> On top level (root folder), each file of the folder is written to the <tt>filesToCrawl</tt> bulks and each subdirectory record goes to a separate <tt>directoriesToCrawl</tt> bulk. Parameters <tt>minFilesPerBulk</tt> and <tt>directoriesPerBulk</tt> are not considered (-&gt; distribution for immediate scale up).
</li><li> In follow-up tasks the handling is:
<ul><li> <tt>minFilesPerBulk</tt>
<ul><li> <i>not configured:</i> only files in the crawled directory are added to <tt>filesToCrawl</tt> bulks, all subdirectories are written to <tt>directoriesToCrawl</tt> bulks.
</li><li> <i>configured:</i> when <tt>minFilesPerBulk</tt> is not reached with all files of the current folder, we step into the immediate subfolder(s) to reach the configured minimum size. If min size is reached, all remaining files of the current subfolder are also written to <tt>filesToCrawl</tt> bulk(s). Remaining subfolders of the current folder and subfolders of already crawled subfolders are written to <tt>directoriesToCrawl</tt> bulks.
</li></ul>
</li><li> <tt>directoriesPerBulk</tt>
<ul><li> <i>not configured:</i> each sub-directory that is not read directly will be written to a seperate <tt>directoriesToCrawl</tt> bulk
</li><li> <i>configured:</i> the given number of sub-directories will be written to the same <tt>directoriesToCrawl</tt> bulk before a new one is started.
</li></ul>
</li></ul>
</li></ul>
<p>Please note that both parameters must be &gt;= 0 and also that <tt>minFilesPerBulk</tt> must be &lt; <tt>maxFilesPerBulk</tt>. Otherwise your job will fail.
</p><p><i>Source</i>:
</p><p>The attribute <tt>_source</tt> is set from the task parameter <tt>dataSource</tt> which has no further meaning currently, but it is needed by the delta service.
</p><p><i>Compounds</i>:
</p><p>If the runnning CompoundExtractor service identifies an object as a extractable compound, it is marked with attribute <tt>_isCompound</tt> set to <tt>true</tt>.
</p>
<ul><li> Dependency: <a href="../SimpleCompoundExtractorService.html" class="mw-redirect" title="SMILA/Documentation/Importing/SimpleCompoundExtractorService">CompoundExtractor service</a>
</li></ul>
<a name="File_Fetcher"></a><h3> <span class="mw-headline"> File Fetcher </span></h3>
<p>For each input record, reads the file referenced in attribute <tt>filePath</tt> and adds the content as attachment <tt>fileContent</tt> and optionally further file properties.
The File Fetcher can be used in combination with the File Crawler where the File Crawler extracts the metadata of files and the Fetcher adds the file content or it can be used individually to get both the file content and metadata properties.
</p>
<a name="Configuration_2"></a><h5> <span class="mw-headline"> Configuration </span></h5>
<ul><li> Worker name: <tt>fileFetcher</tt>
</li><li> Parameters:
<ul><li> <tt>mapping</tt> <i>(req.)</i> needed to get the file path and to add the fetched file content
<ul><li> <tt>filePath</tt> <i>(req.)</i> to read the attribute that contains the file path
</li><li> <tt>fileContent</tt> <i>(req.)</i> attachment name where the file content is written to
</li><li> <tt>fileFolder</tt> <i>(opt.)</i> mapping attribute for the file folder (complete path without file name)
</li><li> <tt>fileName</tt> <i>(opt.)</i> mapping attribute for the file name
</li><li> <tt>fileExtension</tt> <i>(opt.)</i> mapping attribute for the file extension
</li><li> <tt>fileSize</tt> <i>(opt.)</i> mapping attribute for the file size (in bytes)
</li><li> <tt>fileLastModified</tt> <i>(opt.)</i> mapping attribute for the file's last modified date
</li></ul>
</li></ul>
</li><li> Input slots:
<ul><li> <tt>filesToFetch</tt>
</li></ul>
</li><li> Output slots:
<ul><li> <tt>files</tt>
</li></ul>
</li></ul>
<p><br />
</p>
<a name="File_Extractor_Worker"></a><h3> <span class="mw-headline"> File Extractor Worker </span></h3>
<p>Used for extracting compounds (zip, tgz, etc.) in file crawling.
</p>
<a name="Configuration_3"></a><h5> <span class="mw-headline"> Configuration </span></h5>
<ul><li> Worker name: <tt>fileExtractor</tt>
</li><li> Parameters:
<ul><li> <tt>filters</tt> <i>(opt., see File Crawler)</i>
<ul><li> <tt>maxFileSize</tt>: <i>(opt., see File Crawler)</i>
</li><li> <tt>filePatterns</tt>: <i>(opt., see File Crawler)</i>
<ul><li> <tt>include</tt>: <i>(opt., see File Crawler)</i>
</li><li> <tt>exclude</tt>: <i>(opt., see File Crawler)</i>
</li></ul>
</li><li> <tt>folderPatterns</tt>: <i>(opt., see File Crawler)</i>
<ul><li> <tt>include</tt>: <i>(opt., see File Crawler)</i>
</li><li> <tt>exclude</tt>: <i>(opt.)</i> The behaviour is slightly different here to that of the File Crawler: If an exclude pattern matches the folder path of an extracted file, then the file is filtered out. But according to the pattern, files from subdirectories may be imported!
</li></ul>
</li></ul>
</li><li> <tt>mapping</tt> <i>(req.)</i>
<ul><li> <tt>filePath</tt> <i>(req., see File Crawler)</i>: needed to get the file path of the compound file to extract
</li><li> <tt>fileFolder</tt> <i>(opt., see File Crawler)</i>
</li><li> <tt>fileName</tt> <i>(opt., see File Crawler)</i>
</li><li> <tt>fileExtension</tt> <i>(opt., see File Crawler)</i>
</li><li> <tt>fileSize</tt> <i>(opt., see File Crawler)</i>
</li><li> <tt>fileLastModified</tt> <i>(opt., see File Crawler)</i>
</li><li> <tt>fileContent</tt> <i>(req., see File Fetcher)</i>
</li></ul>
</li></ul>
</li><li> Input slots:
<ul><li> <tt>compounds</tt>
</li></ul>
</li><li> Output slots:
<ul><li> <tt>files</tt>
</li></ul>
</li></ul>
<a name="Processing_2"></a><h5> <span class="mw-headline"> Processing </span></h5>
<p>For each input record, an input stream to the described file is created and fed into the CompoundExtractor service to extract the compound elements. If an element is a compound itself, it is also extracted. If it is not a compound, a new record is created. The produced records are converted to look like records produced by the file crawler resp. fetcher, with the attributes and attachment set that are specified in the <tt>mapping</tt> configuration. Additionally, the following attributes are set:
</p>
<ul><li> <tt>_deltaHash</tt>: computed as by the FileCrawler worker
</li><li> <tt>_compoundRecordId</tt>: record ID of top-level compound this element was extracted from
</li><li> <tt>_isCompound</tt>: set to <tt>true</tt> for elements that are compounds themselves.
</li><li> <tt>_compoundPath</tt>: sequence of <tt>filePath</tt> attribute values of the compound objects needed to navigate to the compound element.
</li></ul>
<ul><li> Dependency: <a href="../SimpleCompoundExtractorService.html" class="mw-redirect" title="SMILA/Documentation/Importing/SimpleCompoundExtractorService">CompoundExtractor service</a>
</li></ul>
<a name="Sample_file_crawl_job"></a><h3> <span class="mw-headline"> Sample file crawl job </span></h3>
<p>Job definition that imports all files from root folder "workspace-SMILA", pushing the imported records to job "indexUpdateJob". The following files/folders are filtered out:
</p>
<ul><li> files ending with ".class"
</li><li> files starting with "."
</li><li> folder(-path)s ending with ".svn"
</li></ul>
<pre>
{
&quot;name&quot;:&quot;crawlFileJob&quot;,
&quot;workflow&quot;:&quot;fileCrawling&quot;,
&quot;parameters&quot;:{
&quot;tempStore&quot;:&quot;temp&quot;,
&quot;dataSource&quot;:&quot;files&quot;,
&quot;rootFolder&quot;:&quot;/workspace-SMILA&quot;,
&quot;jobToPushTo&quot;:&quot;indexUpdateJob&quot;,
&quot;mapping&quot;:{
&quot;fileContent&quot;:&quot;Content&quot;,
&quot;filePath&quot;:&quot;Path&quot;,
&quot;fileName&quot;:&quot;FileName&quot;,
&quot;fileExtension&quot;:&quot;FileExtension&quot;
},
&quot;filters&quot;:{
&quot;filePatterns&quot;:{
&quot;exclude&quot;:[&quot;\\..*&quot;, &quot;.*\\.class&quot;]
},
&quot;folderPatterns&quot;:{
&quot;exclude&quot;:[&quot;.*\\.svn&quot;]
}
}
}
}
</pre>
<!--
NewPP limit report
Preprocessor node count: 111/1000000
Post-expand include size: 0/2097152 bytes
Template argument size: 0/2097152 bytes
#ifexist count: 0/100
-->
<!-- Saved in parser cache with key wikidb:pcache:idhash:34874-0!1!0!!en!2!edit=0 and timestamp 20130416174643 -->
<div class="printfooter">
Retrieved from "<a href="File.html">http://wiki.eclipse.org/SMILA/Documentation/Importing/Crawler/File</a>"</div>
<div id="catlinks"><p class='catlinks'><a href="http://wiki.eclipse.org/Special:Categories" title="Special:Categories">Category</a>: <span dir='ltr'><a href="http://wiki.eclipse.org/Category:SMILA" title="Category:SMILA">SMILA</a></span></p></div> <!-- end content -->
<div class="visualClear"></div>
</div>
</div>
</div>
<!-- Yoink of toolbox for phoenix moved up -->
</div>
</div>
<div id="clearFooter"/>
<div id="footer" >
<ul id="footernav">
<li class="first"><a href="http://www.eclipse.org/">Home</a></li>
<li><a href="http://www.eclipse.org/legal/privacy.php">Privacy Policy</a></li>
<li><a href="http://www.eclipse.org/legal/termsofuse.php">Terms of Use</a></li>
<li><a href="http://www.eclipse.org/legal/copyright.php">Copyright Agent</a></li>
<li><a href="http://www.eclipse.org/org/foundation/contact.php">Contact</a></li>
<li><a href="http://wiki.eclipse.org/Eclipsepedia:About" title="Eclipsepedia:About">About Eclipsepedia</a></li>
</ul>
<span id="copyright">Copyright &copy; 2013 The Eclipse Foundation. All Rights Reserved</span>
<p id="footercredit">This page was last modified 10:30, 5 February 2013 by <a href="http://wiki.eclipse.org/index.php?title=User:Daniel.stucky.attensity.com&amp;action=edit" class="new" title="User:Daniel.stucky.attensity.com">Daniel Stucky</a>. Based on work by <a href="http://wiki.eclipse.org/User:Andreas.schank.attensity.com" title="User:Andreas.schank.attensity.com">A. Schank</a>, <a href="http://wiki.eclipse.org/index.php?title=User:Andreas.weber.attensity.com&amp;action=edit" class="new" title="User:Andreas.weber.attensity.com">Andreas Weber</a> and <a href="http://wiki.eclipse.org/index.php?title=User:Juergen.schumacher.attensity.com&amp;action=edit" class="new" title="User:Juergen.schumacher.attensity.com">Juergen Schumacher</a>.</p>
<p id="footerviews">This page has been accessed 1,775 times.</p>
</div>
<script type="text/javascript">
var gaJsHost = (("https:" == document.location.protocol) ? "https://ssl." : "http://www.");
document.write(unescape("%3Cscript src='" + gaJsHost + "google-analytics.com/ga.js' type='text/javascript'%3E%3C/script%3E"));
</script>
<script type="text/javascript">
var pageTracker = _gat._getTracker("UA-910670-4");
pageTracker._trackPageview();
</script>
<!-- <div class="visualClear"></div> -->
<script type="text/javascript">if (window.runOnloadHook) runOnloadHook();</script>
</div>
<!-- Served in 0.153 secs. --></body></html>