/[storm]/storm/org/nongnu/storm/BlockId.java
ViewVC logotype

Diff of /storm/org/nongnu/storm/BlockId.java

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.12 by benja, Tue Apr 22 13:01:21 2003 UTC revision 1.13 by tuukkah, Wed Apr 23 17:27:47 2003 UTC
# Line 53  public final class BlockId { Line 53  public final class BlockId {
53          int dot = uri.lastIndexOf('.');          int dot = uri.lastIndexOf('.');
54          int comma = uri.lastIndexOf(',');          int comma = uri.lastIndexOf(',');
55    
56            if(!uri.startsWith(PREFIX)
57               || dot < 0 || comma < 0            // URN must contain . and ,
58               || dot - comma != 32 + 1        // SHA1 part must be 32 chars
59               || uri.length() - dot != 39 + 1 // TigerTree part must be 39 chars
60               )
61                throw new IllegalArgumentException("Bad block URN: "+uri);
62    
63          contentType = uri.substring(PREFIX_LEN, comma);          contentType = uri.substring(PREFIX_LEN, comma);
64          checkContentType(contentType);          checkContentType(contentType);
65    
         if(!uri.startsWith(PREFIX) || dot < 0 ||  
            comma < 0 || dot < comma)  
             throw new IllegalArgumentException("Bad block URN: "+uri);  
   
66          sha1 = Base32.decode(uri.substring(comma+1, dot));          sha1 = Base32.decode(uri.substring(comma+1, dot));
67          tigertree = Base32.decode(uri.substring(dot+1));          tigertree = Base32.decode(uri.substring(dot+1));
68      }      }

Legend:
Removed from v.1.12  
changed lines
  Added in v.1.13

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26