You need to shutdown your sardine object and create another one, example:
Sardine sardine = SardineFactory.begin();
sardine.createDirectory(url);
if (sardine != null) {
sardine.shutdown();
}
sardine = SardineFactory.begin();
// use again
Pergunta
I am writing a file synchronization client (in Java 1.6) that uses Sardine:
https://code.google.com/p/sardine/
When Sardine loses connection to the server (ie. network outage or change from LAN to WiFi), I am unable to reconnect until I completely stop the client and start it back up again.
I've tried the following:
As far as I can tell the actual networking takes place within AbstractHttpClient, but I am not sure what to try next.
Any suggestions on how I can make this thing re-connect dynamically regardless of the reason?
Nenhuma solução correta
Outras dicas
You need to shutdown your sardine object and create another one, example:
Sardine sardine = SardineFactory.begin();
sardine.createDirectory(url);
if (sardine != null) {
sardine.shutdown();
}
sardine = SardineFactory.begin();
// use again