public com.ettrema.httpclient.File uploadFile(File f, ProgressListener listener) throws FileNotFoundException, IOException, HttpException, NotAuthorizedException, ConflictException, BadRequestException, NotFoundException {
return uploadFile(f.getName(), f, listener);
}
public com.ettrema.httpclient.File uploadFile(String newName, File f, ProgressListener listener) throws FileNotFoundException, IOException, HttpException, NotAuthorizedException, ConflictException, BadRequestException, NotFoundException {
Path newPath = path().child(newName);
children(); // ensure children are loaded
int resultCode = host().doPut(newPath, f, listener);
LogUtils.trace(log, "uploadFile", newPath, " result", resultCode);
Utils.processResultCode(resultCode, newPath.toString());
com.ettrema.httpclient.File child = new com.ettrema.httpclient.File(this, newName, null, f.length());
flush();
notifyOnChildAdded(child);
return child;
}