Class InputHelper
public class InputHelper
extends java.lang.Object
InputStreams. In particular, this class contains shortcuts for:
- opening an
InputStreamattached to the standard input using common names like "-" and "stdin" - opening and reading from a compressed file
- attempting to open an
InputStreamand quitting on failure
More generally, there are two types of shortcuts: stream maps and filter maps:
- Stream Maps
- Stream Maps map filenames onto existing
InputStreams. This feature is designed primarily map the names "-" and "stdin" toSystem.in(thereby allowing users to enter these names at the command line). However, programmers can use any anyMap<String, InputStream>. This feature (1) allows users to specify custom names forSystem.in, and (2) allows the variousopenmethods to easily re-reference existing openInputStreams. - Filter Maps
- Filter maps map file suffixes onto filter-like
InputStreams that pre-process the file being opened. (For example, the default filter map maps the suffix 'bz2' ontoCBZip2InputStream.) Filters are designed primarily to automate the process of opening and decompressing compressed files (bzip2, gzip, etc.). However, they can be used to automate the pre-processing of anyInputStreambased on file suffix.
Note that the open methods that take File objects as parameters do not use stream maps.
File objects are designed to describe specific files. There was little apparent benefit to allowing
File objects to refer to "virtual" files like "-" and "stdin". In addition, the practice seemed to seemed to
have high potential for confusion. Users who want to use both stream maps and filter maps can simply call the
"filename" version of the method in quesiton and pass it file.getAbsolutePath().
Yes, I did go a little overboard with the convenience methods. (Once I added the few I use most, it was trivial to add the rest.)
- Author:
- Zachary Kurmas
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static interfaceInputHelper.FilterFactoryUsed to wrapInputStreamswith the desired filter. -
Field Summary
Fields Modifier and Type Field Description static InputHelper.FilterFactoryBZIP2_FACTORYWraps anInputStreamin aCBZip2InputStreamthat uncompresses it.static java.util.Map<java.lang.String,InputHelper.FilterFactory>DEFAULT_FILTER_FACTORY_MAPAn immutable copy of the map returned bymakeDefaultFilterFactoryMap()static java.util.Map<java.lang.String,java.io.InputStream>DEFAULT_INPUT_STREAM_MAPAn immutable copy of the map returned bymakeDefaultInputStreamMap() -
Method Summary
Modifier and Type Method Description static java.util.Map<java.lang.String,InputHelper.FilterFactory>makeDefaultFilterFactoryMap()Generates a map of common file suffixes to appropriateInputHelper.FilterFactoryobjects.static java.util.Map<java.lang.String,java.io.InputStream>makeDefaultInputStreamMap()Generates a map of common names for the standard input toSystem.in.static java.io.InputStreamopenFilteredInputStream(java.io.File file)static java.io.InputStreamopenFilteredInputStream(java.lang.String filename)CallsopenInputStream(String, java.util.Map, java.util.Map)withnullandDEFAULT_FILTER_FACTORY_MAP.static java.io.InputStreamopenFilteredInputStream(java.lang.String filename, java.util.Map<java.lang.String,java.io.InputStream> streamMap)static java.io.InputStreamopenFilteredInputStreamOrQuit(java.io.File file)CallsopenFilteredInputStream(java.io.File)and exits if the file can't be opened.static java.io.InputStreamopenFilteredInputStreamOrQuit(java.io.File file, java.io.PrintStream error, int exitValue)CallsopenFilteredInputStream(java.io.File)and exits if the file can't be opened.static java.io.InputStreamopenFilteredInputStreamOrQuit(java.lang.String filename, java.util.Map<java.lang.String,java.io.InputStream> streamMap)CallsopenFilteredInputStream(String, java.util.Map)and exists if the file can't be opened.static java.io.InputStreamopenFilteredInputStreamOrQuit(java.lang.String filename, java.util.Map<java.lang.String,java.io.InputStream> streamMap, java.io.PrintStream error, int exitValue)CallsopenFilteredInputStream(String, java.util.Map)and exists if the file can't be opened.static java.io.InputStreamopenInputStream(java.io.File file, java.util.Map<java.lang.String,InputHelper.FilterFactory> filterMap)Opens anInputStreamattached to the specified file using thefilterMap.static java.io.InputStreamopenInputStream(java.lang.String filename, java.util.Map<java.lang.String,java.io.InputStream> streamMap, java.util.Map<java.lang.String,InputHelper.FilterFactory> filterMap)Opens anInputStreamattached to the specified file, usingstreamMapandfilterMap.static java.io.InputStreamopenInputStreamOrQuit(java.io.File file, java.util.Map<java.lang.String,InputHelper.FilterFactory> filterMap)CallsopenInputStream(java.io.File, java.util.Map)and exits if the file can't be opened.static java.io.InputStreamopenInputStreamOrQuit(java.io.File file, java.util.Map<java.lang.String,InputHelper.FilterFactory> filterMap, java.io.PrintStream error, int exitValue)CallsopenInputStream(java.io.File, java.util.Map)and exits if the file can't be opened.static java.io.InputStreamopenInputStreamOrQuit(java.lang.String filename, java.util.Map<java.lang.String,java.io.InputStream> streamMap, java.util.Map<java.lang.String,InputHelper.FilterFactory> filterMap)CallsopenInputStream(String, java.util.Map, java.util.Map)and exits if the file can't be opened.static java.io.InputStreamopenInputStreamOrQuit(java.lang.String filename, java.util.Map<java.lang.String,java.io.InputStream> streamMap, java.util.Map<java.lang.String,InputHelper.FilterFactory> filterMap, java.io.PrintStream error, int exitValue)CallsopenInputStream(String, java.util.Map, java.util.Map)and exits if the file can't be opened.static java.io.InputStreamopenMappedAndFilteredInputStream(java.lang.String filename)static java.io.InputStreamopenMappedAndFilteredInputStreamOrQuit(java.lang.String filename)CallsopenInputStream(String, java.util.Map, java.util.Map)withDEFAULT_INPUT_STREAM_MAPandDEFAULT_FILTER_FACTORY_MAPand exists if the file can't be opened.static java.io.InputStreamopenMappedAndFilteredInputStreamOrQuit(java.lang.String filename, java.io.PrintStream error, int exitValue)CallsopenInputStream(String, java.util.Map, java.util.Map)withDEFAULT_INPUT_STREAM_MAPandDEFAULT_FILTER_FACTORY_MAPand exists if the file can't be opened.static java.io.InputStreamopenMappedInputStream(java.lang.String filename)static java.io.InputStreamopenMappedInputStream(java.lang.String filename, java.util.Map<java.lang.String,InputHelper.FilterFactory> filterMap)static java.io.InputStreamopenMappedInputStreamOrQuit(java.lang.String filename, java.util.Map<java.lang.String,InputHelper.FilterFactory> filterMap)CallsopenMappedInputStream(String, java.util.Map)and exists if the file can't be opened.static java.io.InputStreamopenMappedInputStreamOrQuit(java.lang.String filename, java.util.Map<java.lang.String,InputHelper.FilterFactory> filterMap, java.io.PrintStream error, int exitValue)CallsopenMappedInputStream(String, java.util.Map)and exists if the file can't be opened.static java.io.InputStreamopenUnfilteredInputStream(java.lang.String filename, java.util.Map<java.lang.String,java.io.InputStream> streamMap)CallsopenInputStream(String, java.util.Map, java.util.Map)withnull.static java.io.InputStreamopenUnfilteredInputStreamOrQuit(java.lang.String filename, java.util.Map<java.lang.String,java.io.InputStream> streamMap)CallsopenUnfilteredInputStream(String, java.util.Map)and exists if the file can't be opened.static java.io.InputStreamopenUnfilteredInputStreamOrQuit(java.lang.String filename, java.util.Map<java.lang.String,java.io.InputStream> streamMap, java.io.PrintStream error, int exitValue)CallsopenUnfilteredInputStream(String, java.util.Map)and exists if the file can't be opened.static java.io.InputStreamopenUnmappedInputStream(java.lang.String filename, java.util.Map<java.lang.String,InputHelper.FilterFactory> filterMap)CallsopenInputStream(String, java.util.Map, java.util.Map)withnull.static java.io.InputStreamopenUnmappedInputStreamOrQuit(java.lang.String filename, java.util.Map<java.lang.String,InputHelper.FilterFactory> filterMap)CallsopenUnmappedInputStream(String, java.util.Map)and exists if the file can't be opened.static java.io.InputStreamopenUnmappedInputStreamOrQuit(java.lang.String filename, java.util.Map<java.lang.String,InputHelper.FilterFactory> filterMap, java.io.PrintStream error, int exitValue)CallsopenUnmappedInputStream(String, java.util.Map)and exists if the file can't be opened.
-
Field Details
-
DEFAULT_INPUT_STREAM_MAP
public static final java.util.Map<java.lang.String,java.io.InputStream> DEFAULT_INPUT_STREAM_MAPAn immutable copy of the map returned bymakeDefaultInputStreamMap() -
BZIP2_FACTORY
Wraps anInputStreamin aCBZip2InputStreamthat uncompresses it. -
DEFAULT_FILTER_FACTORY_MAP
public static final java.util.Map<java.lang.String,InputHelper.FilterFactory> DEFAULT_FILTER_FACTORY_MAPAn immutable copy of the map returned bymakeDefaultFilterFactoryMap()
-
-
Method Details
-
makeDefaultInputStreamMap
public static java.util.Map<java.lang.String,java.io.InputStream> makeDefaultInputStreamMap()Generates a map of common names for the standard input toSystem.in.- Returns:
- the map
-
makeDefaultFilterFactoryMap
public static java.util.Map<java.lang.String,InputHelper.FilterFactory> makeDefaultFilterFactoryMap()Generates a map of common file suffixes to appropriateInputHelper.FilterFactoryobjects. For example, the default map maps "bz2" to aFilterFactorythat builds aCBZip2InputStream.- Returns:
- a map of common suffixes to appropriate
InputHelper.FilterFactoryobjects.
-
openInputStream
public static java.io.InputStream openInputStream(java.lang.String filename, java.util.Map<java.lang.String,java.io.InputStream> streamMap, java.util.Map<java.lang.String,InputHelper.FilterFactory> filterMap) throws java.io.FileNotFoundExceptionOpens anInputStreamattached to the specified file, usingstreamMapandfilterMap. Specifically,- If
filenameappears instreamMap, then return thatInputSteam. - If
filename's suffix appears infilterMap, then apply thatFilterFactory. - If neither condition above applies, then return a new
InputStreamattached to the specified file .
Note:
InputStreamsfound instreamMapare not affected by thefilterMap— even if there is an entry infilterMapforfilename's suffix. It is assumed that theInputStreams in thestreamMapwill already be configured with any desired filtering/pre-processing.- Parameters:
filename- the name of the file to open (or one of the keys instreamMap).streamMap- a map of file names to existingInputStreamsfilterMap- a map of file suffixes to filters that will pre-process the file.- Returns:
- either the
InputStreaminstreamMap, or a new, possibly filtered,InputStream. - Throws:
java.io.FileNotFoundException- if the requested file does not exist.InputHelper.FilterFactory.FilterFactoryException- if the specified filter cannot handle the given file.
- If
-
openMappedAndFilteredInputStream
public static java.io.InputStream openMappedAndFilteredInputStream(java.lang.String filename) throws java.io.FileNotFoundExceptionCallsopenInputStream(String, java.util.Map, java.util.Map)withDEFAULT_INPUT_STREAM_MAPandDEFAULT_FILTER_FACTORY_MAP.- Parameters:
filename- the name of the file to open (or one of the keys instreamMap).- Returns:
- either the
InputStreaminstreamMap, or a new, possibly filtered,InputStream. - Throws:
java.io.FileNotFoundException- if the requested file does not exist.InputHelper.FilterFactory.FilterFactoryException- if the specified filter cannot handle the given file.
-
openFilteredInputStream
public static java.io.InputStream openFilteredInputStream(java.lang.String filename, java.util.Map<java.lang.String,java.io.InputStream> streamMap) throws java.io.FileNotFoundException- Parameters:
filename- the name of the file to open (or one of the keys instreamMap).streamMap- a map of file names to existingInputStreams- Returns:
- either the
InputStreaminstreamMap, or a new, possibly filtered,InputStream. - Throws:
java.io.FileNotFoundException- if the requested file does not exist.InputHelper.FilterFactory.FilterFactoryException- if the specified filter cannot handle the given file.
-
openFilteredInputStream
public static java.io.InputStream openFilteredInputStream(java.lang.String filename) throws java.io.FileNotFoundExceptionCallsopenInputStream(String, java.util.Map, java.util.Map)withnullandDEFAULT_FILTER_FACTORY_MAP.- Parameters:
filename- the name of the file to open (or one of the keys instreamMap).- Returns:
- either the
InputStreaminstreamMap, or a new, possibly filtered,InputStream. - Throws:
java.io.FileNotFoundException- if the requested file does not exist.InputHelper.FilterFactory.FilterFactoryException- if the specified filter cannot handle the given file.
-
openUnfilteredInputStream
public static java.io.InputStream openUnfilteredInputStream(java.lang.String filename, java.util.Map<java.lang.String,java.io.InputStream> streamMap) throws java.io.FileNotFoundExceptionCallsopenInputStream(String, java.util.Map, java.util.Map)withnull.- Parameters:
filename- the name of the file to open (or one of the keys instreamMap).streamMap- a map of file names to existingInputStreams- Returns:
- either the
InputStreaminstreamMap, or a newInputStream. - Throws:
java.io.FileNotFoundException- if the requested file does not exist.InputHelper.FilterFactory.FilterFactoryException- if the specified filter cannot handle the given file.
-
openMappedInputStream
public static java.io.InputStream openMappedInputStream(java.lang.String filename, java.util.Map<java.lang.String,InputHelper.FilterFactory> filterMap) throws java.io.FileNotFoundException- Parameters:
filename- the name of the file to open (or one of the keys instreamMap).filterMap- a map of file suffixes to filters that will pre-process the file.- Returns:
- either the
InputStreaminstreamMap, or a new, possibly filtered,InputStream. - Throws:
java.io.FileNotFoundException- if the requested file does not exist.InputHelper.FilterFactory.FilterFactoryException- if the specified filter cannot handle the given file.
-
openMappedInputStream
public static java.io.InputStream openMappedInputStream(java.lang.String filename) throws java.io.FileNotFoundException- Parameters:
filename- the name of the file to open (or one of the keys instreamMap).- Returns:
- either the
InputStreaminstreamMap, or a new, possibly filtered,InputStream. - Throws:
java.io.FileNotFoundException- if the requested file does not exist.InputHelper.FilterFactory.FilterFactoryException- if the specified filter cannot handle the given file.
-
openUnmappedInputStream
public static java.io.InputStream openUnmappedInputStream(java.lang.String filename, java.util.Map<java.lang.String,InputHelper.FilterFactory> filterMap) throws java.io.FileNotFoundExceptionCallsopenInputStream(String, java.util.Map, java.util.Map)withnull.- Parameters:
filename- the name of the file to open (or one of the keys instreamMap).filterMap- a map of file suffixes to filters that will pre-process the file.- Returns:
- a new, possibly filtered,
InputStream. - Throws:
java.io.FileNotFoundException- if the requested file does not exist.InputHelper.FilterFactory.FilterFactoryException- if the specified filter cannot handle the given file.
-
openInputStream
public static java.io.InputStream openInputStream(java.io.File file, java.util.Map<java.lang.String,InputHelper.FilterFactory> filterMap) throws java.io.FileNotFoundExceptionOpens anInputStreamattached to the specified file using thefilterMap. Specifically, if thefile's suffix appears infilterMap, then apply thatFilterFactory, otherwise, return a newInputStreamattached to the specified file- Parameters:
file- the name of the file to openfilterMap- a map of file suffixes to filters that will pre-process the file.- Returns:
- a new, possibly filtered,
InputStream. - Throws:
java.io.FileNotFoundException- if the file cannot be opened.InputHelper.FilterFactory.FilterFactoryException- if the specified filter cannot handle the given file.
-
openFilteredInputStream
public static java.io.InputStream openFilteredInputStream(java.io.File file) throws java.io.FileNotFoundException- Parameters:
file- the file to open- Returns:
- a new, possibly filtered,
InputStream. - Throws:
java.io.FileNotFoundException- if the file cannot be opened.InputHelper.FilterFactory.FilterFactoryException- if the specified filter cannot handle the given file.
-
openInputStreamOrQuit
public static java.io.InputStream openInputStreamOrQuit(java.lang.String filename, java.util.Map<java.lang.String,java.io.InputStream> streamMap, java.util.Map<java.lang.String,InputHelper.FilterFactory> filterMap, java.io.PrintStream error, int exitValue)CallsopenInputStream(String, java.util.Map, java.util.Map)and exits if the file can't be opened.- Parameters:
filename- the name of the file to open (or one of the keys instreamMap).streamMap- a map of file names to existingInputStreamsfilterMap- a map of file suffixes to filters that will pre-process the file.error- thePrintStreamto which to write any errors.exitValue- the value to pass toSystem.exitin the event of an error- Returns:
- either the
InputStreaminstreamMap, or a new, possibly filtered,InputStream.
-
openInputStreamOrQuit
public static java.io.InputStream openInputStreamOrQuit(java.lang.String filename, java.util.Map<java.lang.String,java.io.InputStream> streamMap, java.util.Map<java.lang.String,InputHelper.FilterFactory> filterMap)CallsopenInputStream(String, java.util.Map, java.util.Map)and exits if the file can't be opened.- Parameters:
filename- the name of the file to open (or one of the keys instreamMap).streamMap- a map of file names to existingInputStreamsfilterMap- a map of file suffixes to filters that will pre-process the file.- Returns:
- either the
InputStreaminstreamMap, or a new, possibly filtered,InputStream.
-
openMappedAndFilteredInputStreamOrQuit
public static java.io.InputStream openMappedAndFilteredInputStreamOrQuit(java.lang.String filename, java.io.PrintStream error, int exitValue)CallsopenInputStream(String, java.util.Map, java.util.Map)withDEFAULT_INPUT_STREAM_MAPandDEFAULT_FILTER_FACTORY_MAPand exists if the file can't be opened.- Parameters:
error- thePrintStreamto which to write any errors.exitValue- the value to pass toSystem.exitin the event of an errorfilename- the name of the file to open (or one of the keys instreamMap).- Returns:
- either the
InputStreaminstreamMap, or a new, possibly filtered,InputStream.
-
openMappedAndFilteredInputStreamOrQuit
public static java.io.InputStream openMappedAndFilteredInputStreamOrQuit(java.lang.String filename)CallsopenInputStream(String, java.util.Map, java.util.Map)withDEFAULT_INPUT_STREAM_MAPandDEFAULT_FILTER_FACTORY_MAPand exists if the file can't be opened.- Parameters:
filename- the name of the file to open (or one of the keys instreamMap).- Returns:
- either the
InputStreaminstreamMap, or a new, possibly filtered,InputStream.
-
openFilteredInputStreamOrQuit
public static java.io.InputStream openFilteredInputStreamOrQuit(java.lang.String filename, java.util.Map<java.lang.String,java.io.InputStream> streamMap, java.io.PrintStream error, int exitValue)CallsopenFilteredInputStream(String, java.util.Map)and exists if the file can't be opened.- Parameters:
filename- the name of the file to open (or one of the keys instreamMap).streamMap- a map of file names to existingInputStreamserror- thePrintStreamto which to write any errors.exitValue- the value to pass toSystem.exitin the event of an error- Returns:
- either the
InputStreaminstreamMap, or a new, possibly filtered,InputStream.
-
openFilteredInputStreamOrQuit
public static java.io.InputStream openFilteredInputStreamOrQuit(java.lang.String filename, java.util.Map<java.lang.String,java.io.InputStream> streamMap)CallsopenFilteredInputStream(String, java.util.Map)and exists if the file can't be opened.- Parameters:
filename- the name of the file to open (or one of the keys instreamMap).streamMap- a map of file names to existingInputStreams- Returns:
- either the
InputStreaminstreamMap, or a new, possibly filtered,InputStream.
-
openUnfilteredInputStreamOrQuit
public static java.io.InputStream openUnfilteredInputStreamOrQuit(java.lang.String filename, java.util.Map<java.lang.String,java.io.InputStream> streamMap, java.io.PrintStream error, int exitValue)CallsopenUnfilteredInputStream(String, java.util.Map)and exists if the file can't be opened.- Parameters:
filename- the name of the file to open (or one of the keys instreamMap).streamMap- a map of file names to existingInputStreamserror- thePrintStreamto which to write any errors.exitValue- the value to pass toSystem.exitin the event of an error- Returns:
- either the
InputStreaminstreamMap, or a newInputStream.
-
openUnfilteredInputStreamOrQuit
public static java.io.InputStream openUnfilteredInputStreamOrQuit(java.lang.String filename, java.util.Map<java.lang.String,java.io.InputStream> streamMap)CallsopenUnfilteredInputStream(String, java.util.Map)and exists if the file can't be opened.- Parameters:
filename- the name of the file to open (or one of the keys instreamMap).streamMap- a map of file names to existingInputStreams- Returns:
- either the
InputStreaminstreamMap, or a newInputStream.
-
openMappedInputStreamOrQuit
public static java.io.InputStream openMappedInputStreamOrQuit(java.lang.String filename, java.util.Map<java.lang.String,InputHelper.FilterFactory> filterMap, java.io.PrintStream error, int exitValue)CallsopenMappedInputStream(String, java.util.Map)and exists if the file can't be opened.- Parameters:
filename- the name of the file to open (or one of the keys instreamMap).filterMap- a map of file suffixes to filters that will pre-process the file.error- thePrintStreamto which to write any errors.exitValue- the value to pass toSystem.exitin the event of an error- Returns:
- either the
InputStreamin the default stream map or a new, possibly filtered,InputStream.
-
openMappedInputStreamOrQuit
public static java.io.InputStream openMappedInputStreamOrQuit(java.lang.String filename, java.util.Map<java.lang.String,InputHelper.FilterFactory> filterMap)CallsopenMappedInputStream(String, java.util.Map)and exists if the file can't be opened.- Parameters:
filename- the name of the file to open (or one of the keys instreamMap).filterMap- a map of file suffixes to filters that will pre-process the file.- Returns:
- either the
InputStreamin the default stream map or a new, possibly filtered,InputStream.
-
openUnmappedInputStreamOrQuit
public static java.io.InputStream openUnmappedInputStreamOrQuit(java.lang.String filename, java.util.Map<java.lang.String,InputHelper.FilterFactory> filterMap, java.io.PrintStream error, int exitValue)CallsopenUnmappedInputStream(String, java.util.Map)and exists if the file can't be opened.- Parameters:
filename- the name of the file to open (or one of the keys instreamMap).filterMap- a map of file suffixes to filters that will pre-process the file.error- thePrintStreamto which to write any errors.exitValue- the value to pass toSystem.exitin the event of an error- Returns:
- a new, possibly filtered,
InputStream.
-
openUnmappedInputStreamOrQuit
public static java.io.InputStream openUnmappedInputStreamOrQuit(java.lang.String filename, java.util.Map<java.lang.String,InputHelper.FilterFactory> filterMap)CallsopenUnmappedInputStream(String, java.util.Map)and exists if the file can't be opened.- Parameters:
filename- the name of the file to open (or one of the keys instreamMap).filterMap- a map of file suffixes to filters that will pre-process the file.- Returns:
- a new, possibly filtered,
InputStream.
-
openInputStreamOrQuit
public static java.io.InputStream openInputStreamOrQuit(java.io.File file, java.util.Map<java.lang.String,InputHelper.FilterFactory> filterMap, java.io.PrintStream error, int exitValue)CallsopenInputStream(java.io.File, java.util.Map)and exits if the file can't be opened.- Parameters:
file- thefileto open (or one of the keys instreamMap).filterMap- a map of file suffixes to filters that will pre-process the file.error- thePrintStreamto which to write any errors.exitValue- the value to pass toSystem.exitin the event of an error- Returns:
- either the
InputStreaminstreamMap, or a new, possibly filtered,InputStream.
-
openInputStreamOrQuit
public static java.io.InputStream openInputStreamOrQuit(java.io.File file, java.util.Map<java.lang.String,InputHelper.FilterFactory> filterMap)CallsopenInputStream(java.io.File, java.util.Map)and exits if the file can't be opened.- Parameters:
file- thefileto open (or one of the keys instreamMap).filterMap- a map of file suffixes to filters that will pre-process the file.- Returns:
- either the
InputStreaminstreamMap, or a new, possibly filtered,InputStream.
-
openFilteredInputStreamOrQuit
public static java.io.InputStream openFilteredInputStreamOrQuit(java.io.File file, java.io.PrintStream error, int exitValue)CallsopenFilteredInputStream(java.io.File)and exits if the file can't be opened.- Parameters:
file- thefileto open (or one of the keys instreamMap).error- thePrintStreamto which to write any errors.exitValue- the value to pass toSystem.exitin the event of an error- Returns:
- either the
InputStreaminstreamMap, or a new, possibly filtered,InputStream.
-
openFilteredInputStreamOrQuit
public static java.io.InputStream openFilteredInputStreamOrQuit(java.io.File file)CallsopenFilteredInputStream(java.io.File)and exits if the file can't be opened.- Parameters:
file- thefileto open (or one of the keys instreamMap).- Returns:
- either the
InputStreaminstreamMap, or a new, possibly filtered,InputStream.
-