Ejemplo n.º 1
0
 /**
  * Given a versioned ContentName, extract the version number from the end.
  *
  * @param versionedNamed
  * @exception IllegalArgumentException if the name is unversioned
  * @throws VersionMissingException
  */
 public VersionNumber(ContentName versionedNamed) throws VersionMissingException {
   _version = VersioningProfile.getLastVersionAsTimestamp(versionedNamed);
   _versionComponent = VersioningProfile.timeToVersionComponent(_version);
   _binaryTime = _version.toBinaryTimeAsLong();
 }
Ejemplo n.º 2
0
 /**
  * Test method for
  * org.ccnx.ccn.profiles.VersioningProfile#getLastVersionAsTimestamp(org.ccnx.ccn.protocol.ContentName).
  *
  * @throws VersionMissingException
  */
 @Test
 public void testGetVersionAsTimestamp() throws VersionMissingException {
   CCNTime ts = VersioningProfile.getLastVersionAsTimestamp(abSegName);
   ContentName name = VersioningProfile.addVersion(abName, ts);
   if (!name.equals(abvName)) fail();
 }