Example usage for org.openqa.selenium.io FileHandler delete

List of usage examples for org.openqa.selenium.io FileHandler delete

Introduction

In this page you can find the example usage for org.openqa.selenium.io FileHandler delete.

Prototype

public static boolean delete(File toDelete) 

Source Link

Usage

From source file:com.opera.core.systems.internal.ProfileUtils.java

License:Apache License

/**
 * @return true if folder was deleted, else false
 *//*ww w. ja v a  2  s.  c o m*/
private boolean deleteFolder(String folderPath) {
    return FileHandler.delete(new File(folderPath));
}

From source file:com.opera.core.systems.OperaDriverTest.java

License:Apache License

@Test
@Ignore(products = CORE, value = "core does not support -pd")
public void testSetProfile() throws Exception {
    if (!Platform.getCurrent().is(Platform.LINUX)) {
        return;//from  w ww  .  ja v a  2s  . c om
    }

    FileHandler.delete(new File("/tmp/opera-test-profile/"));

    DesiredCapabilities c = new DesiredCapabilities();
    c.setCapability(OperaDriver.PROFILE, "/tmp/opera-test-profile/");

    TestOperaDriver a;
    try {
        a = new TestOperaDriver(c);
    } catch (Exception e) {
        // If immediately exited, then it doesn't support the flags
        if (e.getMessage().contains("Opera exited immediately")) {
            return;
        } else {
            throw e;
        }
    }

    String profile = a.preferences().get("User Prefs", "Opera Directory").toString();
    assertEquals("/tmp/opera-test-profile/", profile);
    a.quit();
}

From source file:com.opera.core.systems.util.ProfileUtils.java

License:Apache License

/**
 * @return true if folder was deleted, else false
 *//*from  ww w .j  a  va2 s.co  m*/
private boolean deleteFolder(String folderPath) {
    //true if the file or directory was deleted, otherwise false
    return FileHandler.delete(new File(folderPath));
}