/*
Add a file/converter pair.
@param strFileName The target record name.
@param strLinkFileName The File name to use if the target file name is the current file.
@param iFieldSeq The field sequence of the field in thie record to return.
490760
public void addMergeField(String strFileName, String strLinkFileName, int iFieldSeq)
    {
        this.checkArray();
        m_vArray.addElement(new InfoList(strFileName, strLinkFileName, iFieldSeq, null));
    }
364294
public BaseField setupField(int iFieldSeq)
    {
        BaseField field = null;
        //if (iFieldSeq == 0)
        //{
        //  field = new CounterField(this, ID, Constants.DEFAULT_FIELD_LENGTH, null, null);
        //  field.setHidden(true);
        //}
        //if (iFieldSeq == 1)
        //{
        //  field = new RecordChangedField(this, LAST_CHANGED, Constants.DEFAULT_FIELD_LENGTH, null, null);
        //  field.setHidden(true);
        //}
        //if (iFieldSeq == 2)
        //{
        //  field = new BooleanField(this, DELETED, Constants.DEFAULT_FIELD_LENGTH, null, new Boolean(false));
        //  field.setHidden(true);
        //}
        if (iFieldSeq == 3)
            field = new StringField(this, CODE, 30, null, null);
        if (iFieldSeq == 4)
            field = new StringField(this, DESCRIPTION, 50, null, null);
        if (iFieldSeq == 5)
            field = new QueueNameField(this, QUEUE_NAME_ID, Constants.DEFAULT_FIELD_LENGTH, null, null);
        if (iFieldSeq == 6)
            field = new MessageProcessInfoField(this, REPLY_MESSAGE_PROCESS_INFO_ID, Constants.DEFAULT_FIELD_LENGTH, null, null);
        if (iFieldSeq == 7)
            field = new MessageProcessInfoField(this, LOCAL_MESSAGE_PROCESS_INFO_ID, Constants.DEFAULT_FIELD_LENGTH, null, null);
        if (iFieldSeq == 8)
            field = new MessageInfoField(this, MESSAGE_INFO_ID, Constants.DEFAULT_FIELD_LENGTH, null, null);
        if (iFieldSeq == 9)
            field = new MessageTypeField(this, MESSAGE_TYPE_ID, Constants.DEFAULT_FIELD_LENGTH, null, null);
        if (iFieldSeq == 10)
            field = new ProcessTypeField(this, PROCESS_TYPE_ID, Constants.DEFAULT_FIELD_LENGTH, null, null);
        if (iFieldSeq == 11)
            field = new StringField(this, PROCESSOR_CLASS, 127, null, null);
        if (iFieldSeq == 12)
            field = new PropertiesField(this, PROPERTIES, Constants.DEFAULT_FIELD_LENGTH, null, null);
        if (iFieldSeq == 13)
            field = new MessageTransportSelect(this, DEFAULT_MESSAGE_TRANSPORT_ID, Constants.DEFAULT_FIELD_LENGTH, null, null);
        if (iFieldSeq == 14)
            field = new BaseStatusSelect(this, INITIAL_MESSAGE_STATUS_ID, Constants.DEFAULT_FIELD_LENGTH, null, null);
        if (field == null)
            field = super.setupField(iFieldSeq);
        return field;
    }
616607
public BaseField setupField(int iFieldSeq)
    {
        BaseField field = null;
        //if (iFieldSeq == 0)
        //{
        //  field = new CounterField(this, ID, Constants.DEFAULT_FIELD_LENGTH, null, null);
        //  field.setHidden(true);
        //}
        //if (iFieldSeq == 1)
        //{
        //  field = new RecordChangedField(this, LAST_CHANGED, Constants.DEFAULT_FIELD_LENGTH, null, null);
        //  field.setHidden(true);
        //}
        //if (iFieldSeq == 2)
        //{
        //  field = new BooleanField(this, DELETED, Constants.DEFAULT_FIELD_LENGTH, null, new Boolean(false));
        //  field.setHidden(true);
        //}
        if (iFieldSeq == 3)
            field = new StringField(this, CLASS_INFO_CLASS_NAME, 40, null, null);
        if (iFieldSeq == 4)
            field = new ReferenceField(this, CLASS_INFO_ID, Constants.DEFAULT_FIELD_LENGTH, null, null);
        if (iFieldSeq == 5)
            field = new StringField(this, CLASS_FIELD_CLASS, 60, null, null);
        if (iFieldSeq == 6)
            field = new IntegerField(this, CLASS_FIELD_SEQUENCE, Constants.DEFAULT_FIELD_LENGTH, null, new Integer(0));
        if (iFieldSeq == 7)
        {
            field = new StringField(this, CLASS_FIELD_NAME, 40, null, null);
            field.setNullable(false);
        }
        if (iFieldSeq == 8)
            field = new StringField(this, CLASS_FIELD_DESC, 30, null, null);
        if (iFieldSeq == 9)
        {
            field = new StringField(this, CLASS_FIELD_PROTECT, 30, null, null);
            field.addListener(new InitOnceFieldHandler(null));
        }
        if (iFieldSeq == 10)
            field = new MemoField(this, CLASS_FIELD_INITIAL, Constants.DEFAULT_FIELD_LENGTH, null, null);
        if (iFieldSeq == 11)
            field = new MemoField(this, CLASS_FIELD_INITIAL_VALUE, Constants.DEFAULT_FIELD_LENGTH, null, null);
        if (iFieldSeq == 12)
        {
            field = new ClassFieldsTypeField(this, CLASS_FIELDS_TYPE, Constants.DEFAULT_FIELD_LENGTH, null, "ClassFieldsTypeField.NATIVE_FIELD");
            field.addListener(new InitOnceFieldHandler(null));
        }
        if (iFieldSeq == 13)
        {
            field = new IncludeScopeField(this, INCLUDE_SCOPE, Constants.DEFAULT_FIELD_LENGTH, null, new Integer(0x004));
            field.addListener(new InitOnceFieldHandler(null));
        }
        if (field == null)
            field = super.setupField(iFieldSeq);
        return field;
    }
975401
public static Record getRecordFromCode(BaseField field, String strDesc, String strFieldName)
    {
        Record recSecond = ((ReferenceField)field).getReferenceRecord();
        return BaseFixData.getRecordFromCode(field, strDesc, strFieldName, recSecond);
    }
1342476
public Record getRecord(String strFileName)
    {
        Record record = super.getRecord(strFileName);
        if (record == null)
            if (Script.SCRIPT_FILE.equalsIgnoreCase(strFileName))
                record = new Script(this);
        return record;
    }
625224
public synchronized void setFilename(String filename)
    {
        if (filename!=null)
        {
            filename=filename.trim();
            if (filename.length()==0)
                filename=null;
        }
        
        if (isStarted() && _filename!=null && filename==null)
            _out=null;
        
        _reopen=isStarted() &&
            ((_filename==null && filename!=null)||
             (_filename!=null && !_filename.equals(filename)));
        _filename=filename;

        if (!isStarted() && _filename!=null)
            _out=null;
    }
658316
public BaseField getField(String strTableName, int iFieldSeq)   // Lookup this field
    {
        if (this.getRecord(strTableName) != this)
            return null;
        return this.getField(iFieldSeq);
    }
455766
public BaseField setupField(int iFieldSeq)
    {
        BaseField field = null;
        //if (iFieldSeq == 0)
        //{
        //  field = new CounterField(this, ID, Constants.DEFAULT_FIELD_LENGTH, null, null);
        //  field.setHidden(true);
        //}
        //if (iFieldSeq == 1)
        //{
        //  field = new RecordChangedField(this, LAST_CHANGED, Constants.DEFAULT_FIELD_LENGTH, null, null);
        //  field.setHidden(true);
        //}
        //if (iFieldSeq == 2)
        //{
        //  field = new BooleanField(this, DELETED, Constants.DEFAULT_FIELD_LENGTH, null, new Boolean(false));
        //  field.setHidden(true);
        //}
        if (iFieldSeq == 3)
            field = new StringField(this, DESCRIPTION, 30, null, null);
        if (field == null)
            field = super.setupField(iFieldSeq);
        return field;
    }
543645
public BaseField setupField(int iFieldSeq)
    {
        BaseField field = null;
        if (iFieldSeq == 0)
        {
            field = new CounterField(this, ID, Constants.DEFAULT_FIELD_LENGTH, null, null);
            field.setHidden(true);
        }
        //if (iFieldSeq == 1)
        //{
        //  field = new RecordChangedField(this, LAST_CHANGED, Constants.DEFAULT_FIELD_LENGTH, null, null);
        //  field.setHidden(true);
        //}
        //if (iFieldSeq == 2)
        //{
        //  field = new BooleanField(this, DELETED, Constants.DEFAULT_FIELD_LENGTH, null, new Boolean(false));
        //  field.setHidden(true);
        //}
        if (iFieldSeq == 3)
        {
            field = new StringField(this, FIELD_NAME, 40, null, null);
            field.setNullable(false);
        }
        if (iFieldSeq == 4)
            field = new FieldClassField(this, FIELD_CLASS, 40, null, null);
        if (iFieldSeq == 5)
            field = new StringField(this, BASE_FIELD_NAME, 40, null, null);
        if (iFieldSeq == 6)
            field = new StringField(this, DEPENDENT_FIELD_NAME, 40, null, null);
        if (iFieldSeq == 7)
            field = new ShortField(this, MINIMUM_LENGTH, 4, null, null);
        if (iFieldSeq == 8)
            field = new ShortField(this, MAXIMUM_LENGTH, 5, null, null);
        if (iFieldSeq == 9)
            field = new StringField(this, DEFAULT_VALUE, 50, null, null);
        if (iFieldSeq == 10)
            field = new StringField(this, INITIAL_VALUE, 50, null, null);
        if (iFieldSeq == 11)
            field = new StringField(this, FIELD_DESCRIPTION, 100, null, null);
        if (iFieldSeq == 12)
            field = new StringField(this, FIELD_DESC_VERTICAL, 14, null, null);
        if (iFieldSeq == 13)
            field = new FieldTypeField(this, FIELD_TYPE, 1, null, null);
        if (iFieldSeq == 14)
            field = new ShortField(this, FIELD_DIMENSION, 3, null, null);
        if (iFieldSeq == 15)
            field = new StringField(this, FIELD_FILE_NAME, 40, null, null);
        if (iFieldSeq == 16)
            field = new ShortField(this, FIELD_SEQ_NO, 4, null, null);
        if (iFieldSeq == 17)
            field = new BooleanField(this, FIELD_NOT_NULL, 1, null, null);
        if (iFieldSeq == 18)
        {
            field = new StringField(this, DATA_CLASS, 20, null, null);
            field.setVirtual(true);
        }
        if (iFieldSeq == 19)
            field = new BooleanField(this, HIDDEN, Constants.DEFAULT_FIELD_LENGTH, null, null);
        if (iFieldSeq == 20)
        {
            field = new IncludeScopeField(this, INCLUDE_SCOPE, Constants.DEFAULT_FIELD_LENGTH, null, new Integer(0x004));
            field.addListener(new InitOnceFieldHandler(null));
        }
        if (field == null)
            field = super.setupField(iFieldSeq);
        return field;
    }
1158873
def add(self, outputfilename, outputtemplate, inputfilename=None, inputtemplate=None):
        """"""
        if isinstance(outputtemplate,OutputTemplate):
            outputtemplate = outputtemplate.id
        if isinstance(inputtemplate,InputTemplate):
            inputtemplate = inputtemplate.id
        if outputfilename in self:
            outputtemplate, inputfiles = self[outputfilename]
            if inputfilename and inputtemplate:
                inputfiles[inputfilename] = inputtemplate
        else:
            if inputfilename and inputtemplate:
                self[outputfilename] = (outputtemplate, {inputfilename: inputtemplate})
            else:
                self[outputfilename] = (outputtemplate, {})
791312
def _addFilename(self, filename):
        
        cur = self._connection.cursor()
        try:
            cur.execute('INSERT INTO files(name) VALUES (?)', (filename,))
        except sqlite3.IntegrityError as e:
            if str(e).find('UNIQUE constraint failed') > -1:
                raise ValueError('Duplicate file name: %r' % filename)
            else:
                raise
        else:
            fileNumber = cur.lastrowid
            self._connection.commit()
            return fileNumber
55305
function (fieldname, file, filename) {
          const acceptedExtensions = strapi.api.upload.config.acceptedExtensions || [];
          if (acceptedExtensions[0] !== '*' && !_.contains(acceptedExtensions, path.extname(filename))) {
            this.status = 400;
            this.body = {
              message: 'Invalid file format ' + filename ? 'for this file' + filename : ''
            };
          }
        }
497424
public String addFile(File file, String strFileList)
    {
        String strName = file.getName();
        int iJava = strName.indexOf(".java");
        if (iJava != -1) if (iJava == strName.length() - 5)
        {
            String strParent = file.getParent();
            String strPath = file.getPath();
            strFileList += strPath + "/" + strParent;
        }
        return strFileList;
    }
296531
public BaseField setupField(int iFieldSeq)
    {
        BaseField field = null;
        //if (iFieldSeq == 0)
        //{
        //  field = new CounterField(this, ID, Constants.DEFAULT_FIELD_LENGTH, null, null);
        //  field.setHidden(true);
        //}
        //if (iFieldSeq == 1)
        //{
        //  field = new RecordChangedField(this, LAST_CHANGED, Constants.DEFAULT_FIELD_LENGTH, null, null);
        //  field.setHidden(true);
        //}
        //if (iFieldSeq == 2)
        //{
        //  field = new BooleanField(this, DELETED, Constants.DEFAULT_FIELD_LENGTH, null, new Boolean(false));
        //  field.setHidden(true);
        //}
        //if (iFieldSeq == 3)
        //  field = new StringField(this, NAME, 40, null, null);
        if (iFieldSeq == 4)
            field = new ProjectFilter(this, MAIN_PROJECT_ID, Constants.DEFAULT_FIELD_LENGTH, null, null);
        //if (iFieldSeq == 5)
        //  field = new ShortField(this, SEQUENCE, Constants.DEFAULT_FIELD_LENGTH, null, null);
        //if (iFieldSeq == 6)
        //  field = new MemoField(this, COMMENT, Constants.DEFAULT_FIELD_LENGTH, null, null);
        //if (iFieldSeq == 7)
        //  field = new StringField(this, CODE, 30, null, null);
        if (iFieldSeq == 8)
            field = new Project_UserID(this, USER_ID, Constants.DEFAULT_FIELD_LENGTH, null, null);
        if (field == null)
            field = super.setupField(iFieldSeq);
        return field;
    }
52912
protected final void parseFileNamePattern() {
    List converters = new ArrayList();
    List fields = new ArrayList();

    ExtrasPatternParser.parse(
            fileNamePatternStr, converters, fields, null,
            ExtrasPatternParser.getFileNamePatternRules());
    patternConverters = new PatternConverter[converters.size()];
    patternConverters =
      (PatternConverter[]) converters.toArray(patternConverters);
    patternFields = new ExtrasFormattingInfo[converters.size()];
    patternFields = (ExtrasFormattingInfo[]) fields.toArray(patternFields);
  }
1211925
public void syncFilename(String fileName) {
    if (emitLineDirectives) {
      if (!fileName.equals(currentFile)) {
        currentLine = BEGINNING_OF_FILE;
        // C11 spec. (6.10.4) requires a line number between 1 and 2147483647.
        buffer.append(UnicodeUtils.format("\n#line 1 \"%s\"\n", fileName));
      }
    }
    currentFile = fileName;
  }
851729
public BaseField setupField(int iFieldSeq)
    {
        BaseField field = null;
        //if (iFieldSeq == 0)
        //  field = new PackagesReportScreenRecord_ReportDate(this, REPORT_DATE, Constants.DEFAULT_FIELD_LENGTH, null, null);
        //if (iFieldSeq == 1)
        //  field = new PackagesReportScreenRecord_ReportTime(this, REPORT_TIME, Constants.DEFAULT_FIELD_LENGTH, null, null);
        //if (iFieldSeq == 2)
        //  field = new PackagesReportScreenRecord_ReportUserID(this, REPORT_USER_ID, Constants.DEFAULT_FIELD_LENGTH, null, null);
        //if (iFieldSeq == 3)
        //  field = new ShortField(this, REPORT_PAGE, Constants.DEFAULT_FIELD_LENGTH, null, new Short((short)1));
        //if (iFieldSeq == 4)
        //  field = new IntegerField(this, REPORT_COUNT, Constants.DEFAULT_FIELD_LENGTH, null, new Integer(0));
        //if (iFieldSeq == 5)
        //  field = new CurrencyField(this, REPORT_TOTAL, Constants.DEFAULT_FIELD_LENGTH, null, new Double(0));
        //if (iFieldSeq == 6)
        //  field = new IntegerField(this, REPORT_KEY_AREA, Constants.DEFAULT_FIELD_LENGTH, null, null);
        if (iFieldSeq == 7)
            field = new JnlpFileField(this, JNLP_FILE_ID, Constants.DEFAULT_FIELD_LENGTH, null, null);
        if (iFieldSeq == 8)
            field = new StringField(this, TEMPLATE, 120, null, "docs/styles/xsl/cocoon/program/templatebuild.xsl");
        if (iFieldSeq == 9)
            field = new StringField(this, FILEOUT, 256, null, null);
        if (iFieldSeq == 10)
            field = new StringField(this, PACKAGES_TREE, 120, null, null);
        if (iFieldSeq == 11)
            field = new XmlField(this, EXCLUDE_PACKAGES, Constants.DEFAULT_FIELD_LENGTH, null, null);
        if (field == null)
            field = super.setupField(iFieldSeq);
        return field;
    }