public UserHandler(String name, String defaultEmailDomain, String environmentalHash) throws Exception { setEnvironmentalHash(environmentalHash); setUserName(name); setEmailDomain(defaultEmailDomain); }
/** * @param absoluteFilename */ public FileHandler(String absoluteFilename) { initialiseFile(absoluteFilename, false); }
public File getFile() throws Exception { if (!this.fileIsReadable) { this.openFile(); } return this.currentFile; }
public CompareImages(File localFile, WebElement remoteImage, WebDriver driver) throws Exception { this.localFileObject = new FileHandler(localFile); this.remoteImageObject = remoteImage; this.driver = driver; }
public void initialiseFile(String absoluteFilename, boolean value) { setAbsoluteFilename(absoluteFilename); setCreateIfNotExist(value); setAppendToFile(false); }
public UserHandler(String name, String environmentalHash) throws Exception { setEnvironmentalHash(environmentalHash); setUserName(name); }
public File getLocalImage() throws Exception { return this.localFileObject.getFile(); }
/** * Return the result of an XPath query on an XML Document in int format * * @param query - The XPath query * @return int - Result of the query * @throws Exception */ public int performXPathQueryReturnInteger(String query) throws Exception { return Integer.parseInt(performXPathQueryReturnString(query)); }
public final void setAbsoluteFilename(String value) { setFileName(value.replaceFirst("^.*" + sepReg, "")); setFilePath(value.substring(0, value.length() - this.fileName.length())); }
public OutputStream getWritableFileOutputStream() throws Exception { if (!this.fileIsWritable) { this.openFileForWriting(); } return this.writableFileOutputStream; }
/** * Create an Element reference. * * @param locator - XPath location of the element. * @return Element - Element object referenced by the XPath locator. * @throws XPathExpressionException */ private Element getElement(String locator) throws XPathExpressionException { return (Element) constructAnXPathExpression(locator).evaluate(this.xmlDocument, XPathConstants.NODE); }
/** * Add an attribute to an element. * * @param attributeType - Attribute to add (e.g. class). * @param value - Value to assign to the attribute. * @param locator - XPath location of the attribute. * @throws Exception */ public void addAttribute(String attributeType, String value, String locator) throws Exception { Element element = getElement(locator); element.setAttribute(attributeType, value); }
private void storeAttribute(Attr attribute) { if (attribute.getNamespaceURI() != null && attribute.getNamespaceURI().equals(XMLConstants.XMLNS_ATTRIBUTE_NS_URI)) { if (attribute.getNodeName().equals(XMLConstants.XMLNS_ATTRIBUTE)) { addToContext(attribute.getNodeValue()); } else { addToContext(attribute.getLocalName(), attribute.getNodeValue()); } } }
public CompareImages(String localFile, WebElement remoteImage, WebDriver driver) throws Exception { this.localFileObject = new FileHandler(localFile); this.remoteImageObject = remoteImage; this.driver = driver; }
public FileWriter getWriteableFile() throws Exception { if (!this.fileIsWritable) { this.openFileForWriting(); } return this.writeableFile; }
/** * @param absoluteFilename * @param value */ public FileHandler(String absoluteFilename, boolean value) { initialiseFile(absoluteFilename, value); }
/** * Return the result of an XPath query on an XML Document in String format * * @param query - The XPath query * @return String - Result of the query * @throws Exception */ public String performXPathQueryReturnString(String query) throws Exception { return constructAnXPathExpression(query).evaluate(this.xmlDocument, XPathConstants.STRING).toString(); }
public void changeLocalFileTo(File localfile) throws Exception { this.localFileObject = new FileHandler(localfile); }
public void write(String value) throws Exception { if (!this.fileIsWritable) { this.openFileForWriting(); } this.writeableFile.write(value); }
public void changeLocalFileTo(String localfile) throws Exception { this.localFileObject = new FileHandler(localfile); }