ファイル・システムの出力プロパティおよび例

OutputConfigクラスは、出力をレコード出力ファイルに書き込むクロールを構成します。

表1 レコード出力ファイルのモジュール・プロパティ
ファイル・システムのプロパティ・キー名 キー値
outputPrefix 出力ファイルのプリフィクス(CrawlerOutputは、デフォルトのプリフィクスです)。オプションです。
outputDirectory IAS Serverのワークスペース・ディレクトリ下の出力ディレクトリの名前とパス。outputDirectoryのデフォルトの名前は、outputで、<crawlID>デフォルトの名前を使用して、各クロールのサブディレクトリを作成します。これにより、各クロールの出力に一意のサブディレクトリが作成されます。たとえば、outputDirectoryのデフォルト値を使用し、FileSystemCrawl<crawlID>がある場合、結果として作成されるディレクトリ構造はIAS\workspace\output\FileSystemCrawl\になります。
outputXml 出力形式をXMLまたはバイナリのいずれかに設定するブール値。trueを指定すると、出力はXMLに設定されます。falseを指定すると、出力はバイナリに設定されます。デフォルトはfalseです。
outputCompressed 出力ファイルを圧縮する必要があるかどうかを示すブール値。trueを指定すると、出力が圧縮されます。デフォルトは、falseです(圧縮なし)。オプションです。
ファイル・システム・クロールの出力プロパティの例は、次のとおりです。
// Create the output configuration.
OutputConfig outputConfig = new OutputConfig();

// Create a file system module ID.
ModuleId moduleId = new ModuleId("File System");

// Set the module ID in the output configuration.
outputConfig.setModuleId(moduleId);

// Create a module property object.
ModuleProperty outputPrefix = new ModuleProperty();
// set the key for the output prefix
outputPrefix.setKey("outputPrefix");
outputPrefix.getValues().add("newPrefix");

// Set the outputPrefix module property on the output config.
outputConfig.addModuleProperty(outputPrefix);

// Create a module property object.
ModuleProperty outputDirectory = new ModuleProperty();
// Set the key for the output directory.
outputDirectory.setKey("outputDirectory");
outputDirectory.setValues("output");

// Set the outputDirectory module property on the output config.
outputConfig.addModuleProperty(outputDirectory);

// Create a module property object.
ModuleProperty outputXml = new ModuleProperty();
// Set the key for specifying whether output is in XML format.
outputXml.setKey("outputXml");
outputXml.setValues("true");

// Set the outputXml module property on the output config.
outputConfig.addModuleProperty(outputXml);

// Create a module property object.
ModuleProperty outputCompressed = new ModuleProperty();
// Set the key for specifying whether output is compressed.
outputCompressed.setKey("outputCompressed");
outputCompressed.setValues("true");

// Set the outputCompressed module property on the output config.
outputConfig.addModuleProperty(outputCompressed);

// Set the output config in the main crawl configuration.
crawlConfig.setOutputConfig(outputConfig);

// Create the crawl.
crawler.createCrawl(crawlConfig);