Java Stream Close closexBaseJProperty()

Here you can find the source of closexBaseJProperty()

Description

use this if you need to reset the property file which is usually left open

License

Open Source License

Declaration

public static void closexBaseJProperty() 

Method Source Code

//package com.java2s;
/**/*from w  w w  .ja  v a 2  s.co m*/
 * xBaseJ - Java access to dBase files
 *<p>Copyright 1997-2011 - American Coders, LTD  - Raleigh NC USA
 *<p>All rights reserved
 *<p>Currently supports only dBase III format DBF, DBT and NDX files
 *<p>                        dBase IV format DBF, DBT, MDX and NDX files
*<p>American Coders, Ltd
*<br>P. O. Box 97462
*<br>Raleigh, NC  27615  USA
*<br>1-919-846-2014
*<br>http://www.americancoders.com
@author Joe McVerry, American Coders Ltd.
@version 2.2.0
*
 * This library is free software; you can redistribute it and/or
 * modify it under the terms of the GNU Library Lesser General Public
 * License as published by the Free Software Foundation; either
 * version 2 of the License, or (at your option) any later version.
 *
 * This library is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 * Library General Public License for more details.
 *
 * You should have received a copy of the GNU Library Lesser General Public
 * License along with this library; if not, write to the Free
 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
 *
 *  Change History
 *  Date      Developer                 Desc
 *  20110401  Joe McVerry (jrm)   created static field x86Architecture to reduce # of system calls.
 *  20110707  Joe McVerry (jrm)   Properties are not loaded from classpath. In this case is propIS != null, but propFIle == null.
 *                       tracker ID: 3335370
     
*/

import java.io.File;

import java.io.IOException;
import java.io.InputStream;

public class Main {
    static java.util.Properties props = new java.util.Properties();
    static File propFile = null;
    static InputStream propIS = null;

    /**
    * use this if you need to reset the property file which is usually left
    * open
    *
    *
    */
    public static void closexBaseJProperty() {
        synchronized (props) {

            propFile = null;
            if (propIS != null) {
                try {
                    propIS.close();
                } catch (IOException e) {
                }
                propIS = null;
            }
            props = new java.util.Properties();

        }
    }
}

Related

  1. closeWithRuntimeException(Closeable c)
  2. closeWriteFile(FileOutputStream fileoutputstream)
  3. closeWriter(final Writer writer)
  4. closeWriter(PrintWriter pw)
  5. closeWriter(Writer writer)
  6. closeXMLState(int toState)
  7. closeZipOutputStreamQuietly(ZipOutputStream zipOutputStream)
  8. closeZipQuietly(@Nullable ZipFile file)