private static InputStream getConfigFileInputStream() throws IOException {

        String fileName = System
                .getProperty("org.threeten.bp.i18n.HijrahDate.deviationConfigFile");

        if (fileName == null) {
            fileName = DEFAULT_CONFIG_FILENAME;
        }

        String dir = System
                .getProperty("org.threeten.bp.i18n.HijrahDate.deviationConfigDir");

        if (dir != null) {
            if (!(dir.length() == 0 && dir.endsWith(System
                    .getProperty("file.separator")))) {
                dir = dir + System.getProperty("file.separator");
            }
            File file = new File(dir + FILE_SEP + fileName);
            if (file.exists()) {
                try {
                    return new FileInputStream(file);
                } catch (IOException ioe) {
                    throw ioe;
                }
            } else {
                return null;
            }
        } else {
            String classPath = System.getProperty("java.class.path");
            StringTokenizer st = new StringTokenizer(classPath, PATH_SEP);
            while (st.hasMoreTokens()) {
                String path = st.nextToken();
                File file = new File(path);
                if (file.exists()) {
                    if (file.isDirectory()) {
                        File f = new File(
                                path + FILE_SEP + DEFAULT_CONFIG_PATH, fileName);
                        if (f.exists()) {
                            try {
                                return new FileInputStream(path + FILE_SEP
                                        + DEFAULT_CONFIG_PATH + FILE_SEP
                                        + fileName);
                            } catch (IOException ioe) {
                                throw ioe;
                            }
                        }
                    } else {
                        ZipFile zip;
                        try {
                            zip = new ZipFile(file);
                        } catch (IOException ioe) {
                            zip = null;
                        }

                        if (zip != null) {
                            String targetFile = DEFAULT_CONFIG_PATH + FILE_SEP
                                    + fileName;
                            ZipEntry entry = zip.getEntry(targetFile);

                            if (entry == null) {
                                if (FILE_SEP == '/') {
                                    targetFile = targetFile.replace('/', '\\');
                                } else if (FILE_SEP == '\\') {
                                    targetFile = targetFile.replace('\\', '/');
                                }
                                entry = zip.getEntry(targetFile);
                            }

                            if (entry != null) {
                                try {
                                    return zip.getInputStream(entry);
                                } catch (IOException ioe) {
                                    throw ioe;
                                }
                            }
                        }
                    }
                }
            }
            return null;
        }
    }
private static InputStream getConfigFileInputStream ( ) throws IOException { String fileName = System . getProperty ( "org.threeten.bp.i18n.HijrahDate.deviationConfigFile" ) ; if ( fileName == null ) { fileName = DEFAULT_CONFIG_FILENAME ; } String dir = System . getProperty ( "org.threeten.bp.i18n.HijrahDate.deviationConfigDir" ) ; if ( dir != null ) { if ( ! ( dir . length ( ) == 0 && dir . endsWith ( System . getProperty ( "file.separator" ) ) ) ) { dir = dir + System . getProperty ( "file.separator" ) ; } File file = new File ( dir + FILE_SEP + fileName ) ; if ( file . exists ( ) ) { try { return new FileInputStream ( file ) ; } catch ( IOException ioe ) { throw ioe ; } } else { return null ; } } else { String classPath = System . getProperty ( "java.class.path" ) ; StringTokenizer st = new StringTokenizer ( classPath , PATH_SEP ) ; while ( st . hasMoreTokens ( ) ) { String path = st . nextToken ( ) ; File file = new File ( path ) ; if ( file . exists ( ) ) { if ( file . isDirectory ( ) ) { File f = new File ( path + FILE_SEP + DEFAULT_CONFIG_PATH , fileName ) ; if ( f . exists ( ) ) { try { return new FileInputStream ( path + FILE_SEP + DEFAULT_CONFIG_PATH + FILE_SEP + fileName ) ; } catch ( IOException ioe ) { throw ioe ; } } } else { ZipFile zip ; try { zip = new ZipFile ( file ) ; } catch ( IOException ioe ) { zip = null ; } if ( zip != null ) { String targetFile = DEFAULT_CONFIG_PATH + FILE_SEP + fileName ; ZipEntry entry = zip . getEntry ( targetFile ) ; if ( entry == null ) { if ( FILE_SEP == '/' ) { targetFile = targetFile . replace ( '/' , '\\' ) ; } else if ( FILE_SEP == '\\' ) { targetFile = targetFile . replace ( '\\' , '/' ) ; } entry = zip . getEntry ( targetFile ) ; } if ( entry != null ) { try { return zip . getInputStream ( entry ) ; } catch ( IOException ioe ) { throw ioe ; } } } } } } return null ; } }
Return InputStream for deviation configuration file.
The default location of the deviation file is:
<pre>
$CLASSPATH/org/threeten/bp/chrono
</pre>
And the default file name is:
<pre>
hijrah_deviation.cfg
</pre>
The default location and file name can be overriden by setting
following two Java's system property.
<pre>
Location: org.threeten.bp.i18n.HijrahDate.deviationConfigDir
File name: org.threeten.bp.i18n.HijrahDate.deviationConfigFile
</pre>
Regarding the file format, see readDeviationConfig() method for details.

@return InputStream for file reading exception.
@throws IOException for zip/jar file handling exception.