private String getDatastreamId ( DigitalObject obj , Entry entry ) { String entryId = entry . getId ( ) . toString ( ) ; // matches info:fedora/pid/dsid/timestamp Pattern pattern = Pattern . compile ( "^" + Constants . FEDORA . uri + ".+?/([^/]+)/?.*" ) ; Matcher matcher = pattern . matcher ( entryId ) ; if ( matcher . find ( ) ) { return matcher . group ( 1 ) ; } else { return obj . newDatastreamID ( ) ; } }
Parses the id to determine a datastreamId .