Logo Search packages:      
Sourcecode: jakarta-jmeter version File versions  Download package

HTTPFileArg [] org::apache::jmeter::protocol::http::sampler::HTTPSamplerBase::getHTTPFiles (  )  [inline, inherited]

Get the collection of files as a list. The list is built up from the filename/filefield/mimetype properties, plus any additional entries saved in the FILE_ARGS property.

If there are no valid file entries, then an empty list is returned.

an array of file arguments (never null)

Definition at line 1471 of file HTTPSamplerBase.java.

References org::apache::jmeter::protocol::http::util::HTTPFileArgs::asArray(), org::apache::jmeter::protocol::http::util::HTTPFileArgs::getHTTPFileArgCount(), and org::apache::jmeter::protocol::http::util::HTTPFileArg::isNotEmpty().

Referenced by org::apache::jmeter::protocol::http::gui::HTTPFileArgsPanel::configure(), org::apache::jmeter::protocol::http::sampler::HTTPSamplerBase::getSendFileAsPostBody(), org::apache::jmeter::protocol::http::sampler::HTTPSamplerBase::getUseMultipartForPost(), and org::apache::jmeter::protocol::http::sampler::HTTPSampler2::sendPutData().

        if (fileList != null){
            return fileList;
        HTTPFileArg[] outFiles;
        // Check for original data names
        // Use properties so variables and functions are not resolved too early
        JMeterProperty fileName = getProperty(FILE_NAME);
        JMeterProperty paramName = getProperty(FILE_FIELD);
        JMeterProperty mimeType = getProperty(MIMETYPE);
        HTTPFileArg file = new HTTPFileArg(fileName, paramName, mimeType);
        if(file.isNotEmpty()) {
            // Now deal with any additional file arguments
            final HTTPFileArgs fileArgs = getHTTPFileArgs();
            if(fileArgs != null) {
                outFiles = new HTTPFileArg[1+fileArgs.getHTTPFileArgCount()];
                outFiles[0] = file; // first file
                HTTPFileArg[] infiles = fileArgs.asArray();
                for (int i = 0; i < infiles.length; i++){
                    outFiles[i+1] = infiles[i];
            } else {
                outFiles = new HTTPFileArg[]{file}; // just one file
        } else {
            outFiles = new HTTPFileArg[]{}; // no files, empty array
        fileList = outFiles; // update the list cache
        return fileList;

Generated by  Doxygen 1.6.0   Back to index