com.univocity.api.io
Class InputFileQueue

java.lang.Object
  extended by com.univocity.api.io.ReaderProvider
      extended by com.univocity.api.io.InputQueue<FileProvider>
          extended by com.univocity.api.io.InputFileQueue
All Implemented Interfaces:
ResourceProvider<Reader>

public class InputFileQueue
extends InputQueue<FileProvider>

A queue of a sequence of files to be processed. Variables can be used to assign values to each file and provide more control and information about what the file represents (e.g. date the file was produced, some user ID associated with the file, etc)

Author:
uniVocity Software Pty Ltd - dev@univocity.com
See Also:
InputQueue, FileProvider

Constructor Summary
InputFileQueue()
           
 
Method Summary
 void addFile(File file)
          Adds a java.io.File to the queue.
 void addFile(File file, Charset encoding)
          Adds a java.io.File to the queue.
 void addFile(FileProvider fileProvider)
          Adds a FileProvider to the input queue.
 void addFile(File file, String encoding)
          Adds a java.io.File to the queue.
 void addFile(String filePath)
          Adds a path to a file or resource to the queue.
 void addFile(String filePath, Charset encoding)
          Adds a path to a file or resource to the queue.
 void addFile(String filePath, String encoding)
          Adds a path to a file or resource to the queue.
protected  Reader open(FileProvider input)
          Opens an input and returns an instanceof Reader which will be used to consume it.
 
Methods inherited from class com.univocity.api.io.InputQueue
assignVariablesToLastEntry, assignVariableToLastEntry, getCurrentVariables, getResource, isEmpty, offer, peek, readVariable, readVariable, readVariable, size
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

InputFileQueue

public InputFileQueue()
Method Detail

addFile

public void addFile(File file)
Adds a java.io.File to the queue. The default character encoding will be used to read this file.

Parameters:
file - the file to be added to this input queue.

addFile

public void addFile(File file,
                    String encoding)
Adds a java.io.File to the queue.

Parameters:
file - the file to be added to this input queue.
encoding - the encoding to be used when reading from the given file

addFile

public void addFile(File file,
                    Charset encoding)
Adds a java.io.File to the queue.

Parameters:
file - the file to be added to this input queue.
encoding - the encoding to be used when reading from the given file

addFile

public void addFile(String filePath)
Adds a path to a file or resource to the queue. The path can contain environment variables such as {user.home} The default character encoding will be used to read this file.

Parameters:
filePath - the file to be added to this input queue.

addFile

public void addFile(String filePath,
                    String encoding)
Adds a path to a file or resource to the queue. The path can contain environment variables such as {user.home}

Parameters:
filePath - the file to be added to this input queue.
encoding - the encoding to be used when reading from the given file

addFile

public void addFile(String filePath,
                    Charset encoding)
Adds a path to a file or resource to the queue. The path can contain environment variables such as {user.home}

Parameters:
filePath - the file to be added to this input queue.
encoding - the encoding to be used when reading from the given file

addFile

public void addFile(FileProvider fileProvider)
Adds a FileProvider to the input queue.

Parameters:
fileProvider - the next file to add to the queue.

open

protected Reader open(FileProvider input)
Description copied from class: InputQueue
Opens an input and returns an instanceof Reader which will be used to consume it. Used when InputQueue.getResource() is called.

Specified by:
open in class InputQueue<FileProvider>
Parameters:
input - the input to be read
Returns:
Reader that can be used to consume the given input.


Copyright © 2018 uniVocity Software Pty Ltd. All rights reserved.