public int getHTTPFileCount() { return getHTTPFiles().length; } /**
/** * * 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. * <p> * If there are no valid file entries, then an empty list is returned. * <p> * Invokes {@link HTTPSamplerBase#getHTTPFiles()} * * @return an array of file arguments (never <code>null</code>) */ protected HTTPFileArg[] getHTTPFiles() { return testElement.getHTTPFiles(); }
/** * Determine if the file should be sent as the entire Content body, * i.e. without any additional wrapping. * * @return true if specified file is to be sent as the body, * i.e. there is a single file entry which has a non-empty path and * an empty Parameter name. */ public boolean getSendFileAsPostBody() { // If there is one file with no parameter name, the file will // be sent as post body. HTTPFileArg[] files = getHTTPFiles(); return (files.length == 1) && (files[0].getPath().length() > 0) && (files[0].getParamName().length() == 0); }
/** * Determine if we should use multipart/form-data or * application/x-www-form-urlencoded for the post * * @return true if multipart/form-data should be used and method is POST */ public boolean getUseMultipartForPost() { // We use multipart if we have been told so, or files are present // and the files should not be send as the post body HTTPFileArg[] files = getHTTPFiles(); return HTTPConstants.POST.equals(getMethod()) && (getDoMultipart() || (files.length > 0 && hasNoMissingFile(files) && !getSendFileAsPostBody())); }
/** * Determine if we should use multipart/form-data or * application/x-www-form-urlencoded for the post * * @return true if multipart/form-data should be used and method is POST */ public boolean getUseMultipart() { // We use multipart if we have been told so, or files are present // and the files should not be send as the post body HTTPFileArg[] files = getHTTPFiles(); return getDoMultipart() || (files.length>0 && hasNoMissingFile(files) && !getSendFileAsPostBody()); }
/** * A newly created component can be initialized with the contents of a * HTTPSamplerBase object by calling this method. The component is responsible for * querying the Test Element object for the relevant information to display * in its GUI. * * @param testElement the HTTPSamplerBase to be used to configure the GUI */ public void configure(TestElement testElement) { if (testElement instanceof HTTPSamplerBase) { HTTPSamplerBase base = (HTTPSamplerBase) testElement; tableModel.clearData(); for(HTTPFileArg file : base.getHTTPFiles()){ tableModel.addRow(file); } checkDeleteAndBrowseStatus(); } }
HTTPFileArg[] files = sampler.getHTTPFiles();
boolean hasContentTypeHeader = contentTypeHeader != null && contentTypeHeader.length() > 0; HTTPFileArg[] files = sampler.getHTTPFiles();
HTTPFileArg[] files = sampler.getHTTPFiles();