Home > Contents > Index >
FormPoster.setOutputDirectory
Sets the directory where the post results output file should be written.
Syntax
public void setOutputDirectory(sDir outputdir)Parameters
outputdir
- The directory path. If null, no output file is written.
Description
The
setOutputDirectory
method sets the directory where the post results output file should be written. getOutputFileSpec must be called after the post to determine the name of the file where the output has been written.Example
FormPoster fp = new FormPoster(); FTValList vlCookies; fp.setURL("http://myserver/servlet/CatalogManager"); // Add a new row to MyTable FTStatusCode ftStatus = new FTStatusCode(); status = fp.login(true, ftStatus, "myusername", "mypassword"); vlCookies = fp.findAllCookies(); Status = fp.addFile("url", "test.html", "/export/home/temp/test.html", "text/html"); Status = fp.addTextValue("tblname", "MyTable"); Status = fp.addURL("myparameter", "http://server/main.html"); Status = fp.addTextValue("id", "1323"); Status = fp.addTextValue("ftcmd", "addrow"); fp.setCookies(vlCookies); // Write the post results to a file fp.setOutputDirectory("/export/home/mydirectory"); Status = fp.post(); int nLastErrorCode = fp.getLastError(); String sLastError = fp.getLastErrorStr(); // Fetch the output file name String sOutputFile = fp.getOutputFileSpec(); Fp.login(false, null, null);See Also
Home > Contents > Index > ![]()
Oracle JAVA Reference
Copyright (c) 2013, 2019, Oracle and/or its affiliates. All rights reserved.