com.sikulix.vnc.BasicUserPasswdGetter Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of sikulix2tigervnc Show documentation
Show all versions of sikulix2tigervnc Show documentation
... for visual testing and automation (TigerVNC support)
The newest version!
/*
* Copyright (c) 2017 - sikulix.com - MIT license
*/
package com.sikulix.vnc;
import com.tigervnc.rfb.UserPasswdGetter;
/**
* Simple implementation of UserPasswdGetter that returns a fixed password.
*/
class BasicUserPasswdGetter implements UserPasswdGetter
{
private final String password;
public BasicUserPasswdGetter(String password)
{
this.password = password;
}
@Override
public boolean getUserPasswd(StringBuffer user, StringBuffer passwd)
{
if (user != null) {
user.setLength(0);
}
if (password != null) {
passwd.setLength(0);
passwd.append(password);
return true;
} else {
return false;
}
}
}
© 2015 - 2024 Weber Informatics LLC | Privacy Policy