tdcommon/src/main/java/thredds/server/catalog/tracker/DataRootExt.java
public void writeExternal(DataOutputStream out) throws IOException {
    ConfigCatalogExtProto.DataRoot.Builder builder = ConfigCatalogExtProto.DataRoot.newBuilder();
    builder.setUrlPath(path);
    builder.setDirLocation(dirLocation);
    builder.setType(convertDataRootType(type));
    if (type != DataRoot.Type.datasetRoot) {
      builder.setCatLocation(catLocation);
      builder.setName(name);
    }
    if (restrict != null)
      builder.setRestrict(restrict);

    ConfigCatalogExtProto.DataRoot index = builder.build();
    byte[] b = index.toByteArray();
    out.writeInt(b.length);
    out.write(b);

    total_count++;
    total_nbytes += b.length + 4;
    if (debug) System.out.printf(" %d: DataRootExt.writeExternal len=%d total=%d%n", total_count, b.length, total_nbytes);
  }
public void writeExternal(DataOutputStream out) throws IOException {
    ConfigCatalogExtProto.DataRoot.Builder builder = ConfigCatalogExtProto.DataRoot.newBuilder();
    builder.setUrlPath(path);
    builder.setDirLocation(dirLocation);
    builder.setType(convertDataRootType(type));
    if (type != DataRoot.Type.datasetRoot) {
      builder.setCatLocation(catLocation);
      builder.setName(name);
    }
    if (restrict != null)
      builder.setRestrict(restrict);

    ConfigCatalogExtProto.DataRoot index = builder.build();
    byte[] b = index.toByteArray();
    out.writeInt(b.length);
    out.write(b);

    total_count++;
    total_nbytes += b.length + 4;
    if (debug) System.out.printf(" %d: DataRootExt.writeExternal len=%d total=%d%n", total_count, b.length, total_nbytes);
  }
public void writeExternal ( DataOutputStream out ) throws IOException { ConfigCatalogExtProto . DataRoot . Builder builder = ConfigCatalogExtProto . DataRoot . newBuilder ( ) ; builder . setUrlPath ( path ) ; builder . setDirLocation ( dirLocation ) ; builder . setType ( convertDataRootType ( type ) ) ; if ( type != DataRoot . Type . datasetRoot ) { builder . setCatLocation ( catLocation ) ; builder . setName ( name ) ; } if ( restrict != null ) builder . setRestrict ( restrict ) ; ConfigCatalogExtProto . DataRoot index = builder . build ( ) ; byte [ ] b = index . toByteArray ( ) ; out . writeInt ( b . length ) ; out . write ( b ) ; total_count ++ ; total_nbytes += b . length + 4 ; if ( debug ) System . out . printf ( " %d: DataRootExt.writeExternal len=%d total=%d%n" , total_count , b . length , total_nbytes ) ; }
/* message DataRoot {
required string urlPath = 1;
required string dirLocation = 2;
required DataRootType type = 3;
optional string catLocation = 4;    // omit for simple dataset root
}
/ * message DataRoot { required string urlPath = 1 ; required string dirLocation = 2 ; required DataRootType type = 3 ; optional string catLocation = 4 ; // omit for simple dataset root }