Using Protobuf to process a config file
<p>I'm relatively new to Protobufs and I was wondering how I would use it to process a list of structures. </p>

<p>Lets say I have a configuration file that looks like this:</p>

<pre><code>Bucket{
    name = "A";
    path = "~/Document/...";
    traffic = 5;
}
Bucket{
    name = "B";
    path = "~/Document/...";
    traffic = 6;
}
Bucket{
    name = "C";
    path = "~/Document/...";
    traffic = 7;
}
</code></pre>

<p>etc etc. </p>

<p>So I am using a protobuf to essentially structure this for ease of use later in  Java. I'm essentially trying to make a map in a map (a protobuf to help find the correct bucket, and then another map to obtain member attributes inside the bucket). </p>

<pre><code>option java_outer_classname = "Buckets";

message Bucket {
    required string name = 1;
    required string path = 2;
    optional int32 traffic = 3;
}

message BucketList {
    required Bucket bucket = 1;
}
</code></pre>

<p>I'm confused on how I would link the two, as in, how would I pass the configuration file into the protobuf methods (after it compiles into a java class) and use to to access the bucket member to do stuff like say get the path from the bucket with the name A? </p>

<p>Thank you!  </p>