use of nl.uva.vlet.vfs.webdavfs.WebdavFile in project lobcder by skoulouzis.
the class VPDRI method upload.
// private void debug(String msg) {
// if (debug) {
// // System.err.println(this.getClass().getName() + ": " + msg);
// log.debug(msg);
// }
// }
private void upload(PDRI source) throws VlException, IOException {
VFile file = getVfsClient().createFile(vrl, true);
try {
if (file instanceof CloudFile) {
CloudFile uFile = (CloudFile) file;
VFile sourceFile = getVfsClient().openFile(new VRL(source.getURI()));
uFile.uploadFrom(sourceFile);
} else if (file instanceof WebdavFile) {
WebdavFile wFile = (WebdavFile) file;
VFile sourceFile = getVfsClient().openFile(new VRL(source.getURI()));
wFile.uploadFrom(sourceFile);
}
reconnectAttemts = 0;
} catch (Exception ex) {
if (reconnectAttemts < Constants.RECONNECT_NTRY) {
reconnect();
upload(source);
} else {
throw ex;
}
} catch (Throwable ex) {
if (reconnectAttemts < Constants.RECONNECT_NTRY) {
reconnect();
upload(source);
} else {
throw ex;
}
}
}
Aggregations