getDownloadUrl method

String getDownloadUrl(
  1. String baseUrl,
  2. String namespace,
  3. String table
)

Generate a download URL for this file.

  • baseUrl — KalamDB server URL (e.g. http://localhost:18080).
  • namespace — table namespace (usually "default").
  • table — table name (e.g. "messages").
final url = ref.getDownloadUrl('http://localhost:18080', 'default', 'messages');
// → http://localhost:18080/v1/files/default/messages/f0001/12345-photo.jpg

Implementation

String getDownloadUrl(String baseUrl, String namespace, String table) {
  final base = baseUrl.replaceFirst(RegExp(r'/+$'), '');
  return '$base${relativeUrl(namespace, table)}';
}