Exemplo n.º 1
0
  /** closeFile Close the current file, but keep its path so we can easily open it again. */
  public void closeFile() throws NexusException {
    try {
      if (m_nfFile != null) {
        m_nfFile.close();
        m_nfFile.finalize();
      }
      m_nfFile = null;

    } catch (Throwable t) {
      if (g_mutex.isLocked() && g_curFile.equals(m_sFilePath)) {
        if (g_mutex.getHoldCount() - 1 == 0) {
          g_curFile = "";
        }
        g_mutex.unlock();
      }
      if (t instanceof NexusException) {
        throw (NexusException) t;
      } else {
        t.printStackTrace();
        return;
      }
    }
    if (g_mutex.isLocked() && g_curFile.equals(m_sFilePath)) {
      if (g_mutex.getHoldCount() - 1 == 0) {
        g_curFile = "";
      }

      g_mutex.unlock();
    }
  }