Пример #1
0
  /**
   * Run the file load file processors
   *
   * @param context DiskDeviceContext
   * @param state FileState
   * @param segment FileSegment
   */
  protected final void runFileLoadedProcessors(
      DiskDeviceContext context, FileState state, FileSegment segment) {

    // Check if there are any file processors configured

    if (m_fileProcessors == null || m_fileProcessors.numberOfProcessors() == 0) return;

    try {

      // Run all of the file load processors

      for (int i = 0; i < m_fileProcessors.numberOfProcessors(); i++) {

        // Get the current file processor

        FileProcessor fileProc = m_fileProcessors.getProcessorAt(i);

        // Run the file processor

        fileProc.processLoadedFile(context, state, segment);
      }

      // Make sure the file segment is closed after processing

      segment.closeFile();
    } catch (Exception ex) {

      // DEBUG

      if (Debug.EnableError && hasDebug()) {
        Debug.println("$$ Load file processor exception");
        Debug.println(ex);
      }
    }
  }