Code example for File

Methods: getParent

0
    private void createRemoteDir(ITestDevice device, String remoteFilePath)
            throws DeviceNotAvailableException { 
        if (device.doesFileExist(remoteFilePath)) {
            return; 
        } 
        File f = new File(remoteFilePath);
        String parentPath = f.getParent();
        if (parentPath != null) {
            createRemoteDir(device, parentPath);
        } 
        device.executeShellCommand(String.format("mkdir %s", remoteFilePath));
    } 
}