예제 #1
0
 @Override
 public void performAddlTestCreateBag(Bag bag) {
   BagInfoTxt bagInfo = bag.getBagInfoTxt();
   assertEquals(
       bagInfo.getBagSize(),
       bagInfo.get(gov.loc.repository.bagit.v0_95.impl.BagInfoTxtImpl.FIELD_PACKAGE_SIZE));
   assertEquals(
       bagInfo.getBaggingDate(),
       bagInfo.get(gov.loc.repository.bagit.v0_95.impl.BagInfoTxtImpl.FIELD_PACKING_DATE));
 }
  public BaggerSourceOrganization(BagInfoTxt bagInfoTxt) {
    contact = new Contact(false);
    if (bagInfoTxt.getContactName() != null && !bagInfoTxt.getContactName().trim().isEmpty()) {
      contact.setContactName(
          ProfileField.createProfileField(Contact.FIELD_CONTACT_NAME, bagInfoTxt.getContactName()));
    } else {
      contact.setContactName(ProfileField.createProfileField(Contact.FIELD_CONTACT_NAME, ""));
    }
    if (bagInfoTxt.getContactPhone() != null && !bagInfoTxt.getContactPhone().trim().isEmpty()) {
      contact.setTelephone(
          ProfileField.createProfileField(
              Contact.FIELD_CONTACT_PHONE, bagInfoTxt.getContactPhone()));
    } else {
      contact.setTelephone(ProfileField.createProfileField(Contact.FIELD_CONTACT_PHONE, ""));
    }
    if (bagInfoTxt.getContactEmail() != null && !bagInfoTxt.getContactEmail().trim().isEmpty()) {
      contact.setEmail(
          ProfileField.createProfileField(
              Contact.FIELD_CONTACT_EMAIL, bagInfoTxt.getContactEmail()));
    } else {
      contact.setEmail(ProfileField.createProfileField(Contact.FIELD_CONTACT_EMAIL, ""));
    }

    if (bagInfoTxt.getSourceOrganization() != null
        && !bagInfoTxt.getSourceOrganization().trim().isEmpty()) {
      setOrganizationName(bagInfoTxt.getSourceOrganization());
    } else {
      setOrganizationName("");
    }
    if (bagInfoTxt.getOrganizationAddress() != null
        && !bagInfoTxt.getOrganizationAddress().trim().isEmpty()) {
      setOrganizationAddress(bagInfoTxt.getOrganizationAddress());
    } else {
      setOrganizationAddress("");
    }
  }