use of ch.cyberduck.core.Profile in project cyberduck by iterate-ch.
the class AbstractBrickTest method setup.
@Before
public void setup() throws Exception {
final ProtocolFactory factory = new ProtocolFactory(new HashSet<>(Collections.singleton(new BrickProtocol())));
final Profile profile = new ProfilePlistReader(factory).read(this.getClass().getResourceAsStream("/Brick.cyberduckprofile"));
final Host host = new Host(profile, "mountainduck.files.com", new Credentials(System.getProperties().getProperty("brick.user"), System.getProperties().getProperty("brick.password")));
session = new BrickSession(host, new DefaultX509TrustManager(), new DefaultX509KeyManager());
final LoginConnectionService login = new LoginConnectionService(new DisabledLoginCallback() {
@Override
public Credentials prompt(final Host bookmark, final String title, final String reason, final LoginOptions options) {
fail(reason);
return null;
}
}, new DisabledHostKeyCallback(), new DisabledPasswordStore(), new DisabledProgressListener());
login.check(session, new DisabledCancelCallback());
}
use of ch.cyberduck.core.Profile in project cyberduck by iterate-ch.
the class AbtractBoxTest method setup.
@Before
public void setup() throws Exception {
final ProtocolFactory factory = new ProtocolFactory(new HashSet<>(Collections.singleton(new BoxProtocol())));
final Profile profile = new ProfilePlistReader(factory).read(this.getClass().getResourceAsStream("/Box.cyberduckprofile"));
final Host host = new Host(profile, profile.getDefaultHostname(), new Credentials("cyberduck"));
session = new BoxSession(host, new DefaultX509TrustManager(), new DefaultX509KeyManager());
final LoginConnectionService login = new LoginConnectionService(new DisabledLoginCallback() {
@Override
public Credentials prompt(final Host bookmark, final String title, final String reason, final LoginOptions options) {
fail(reason);
return null;
}
}, new DisabledHostKeyCallback(), new TestPasswordStore(), new DisabledProgressListener());
login.check(session, new DisabledCancelCallback());
}
use of ch.cyberduck.core.Profile in project cyberduck by iterate-ch.
the class ProfileDictionary method deserialize.
public Profile deserialize(Object serialized) {
final Deserializer<String> dict = deserializer.create(serialized);
final String protocol = dict.stringForKey("Protocol");
if (StringUtils.isNotBlank(protocol)) {
final Protocol parent = protocols.forName(protocols.find(new Predicate<Protocol>() {
@Override
public boolean test(final Protocol protocol) {
// Return default registered protocol specification as parent but not other profile
return !(protocol.isEnabled() || protocol.isBundled());
}
}), protocol, null);
if (null == parent) {
log.error(String.format("Unknown protocol %s in profile", protocol));
return null;
}
return new Profile(parent, dict);
}
log.error("Missing protocol in profile");
return null;
}
use of ch.cyberduck.core.Profile in project cyberduck by iterate-ch.
the class LocalProfilesFinderTest method find.
@Test
public void find() throws Exception {
final ProfilePlistReader reader = new ProfilePlistReader(new ProtocolFactory(Collections.singleton(new TestProtocol() {
@Override
public Type getType() {
return Type.s3;
}
@Override
public boolean isEnabled() {
return false;
}
})));
final Profile profile = reader.read(new Local("src/test/resources/Test S3 (HTTP).cyberduckprofile"));
final LocalProfilesFinder finder = new LocalProfilesFinder(ProtocolFactory.get(), new Local("src/test/resources/"));
final Set<ProfileDescription> stream = finder.find();
assertFalse(stream.isEmpty());
}
use of ch.cyberduck.core.Profile in project cyberduck by iterate-ch.
the class DropboxProtocolTest method testDefaultProfile.
@Test
public void testDefaultProfile() throws Exception {
final ProtocolFactory factory = new ProtocolFactory(new HashSet<>(Collections.singleton(new DropboxProtocol())));
final Profile profile = new ProfilePlistReader(factory).read(this.getClass().getResourceAsStream("/Dropbox.cyberduckprofile"));
assertFalse(profile.isHostnameConfigurable());
assertFalse(profile.isPortConfigurable());
assertFalse(profile.isUsernameConfigurable());
assertFalse(profile.isPasswordConfigurable());
}
Aggregations