Examples of AtomDate


Examples of org.apache.abdera.model.AtomDate

  }
 
  @Test
  public void testAtomDate() {
    Date now = new Date();
    AtomDate atomNow = AtomDate.valueOf(now);
    String rfc3339 = atomNow.getValue();
    atomNow = AtomDate.valueOf(rfc3339);
    Date parsed = atomNow.getDate();
    assertEquals(now, parsed);
  }
View Full Code Here

Examples of org.apache.abdera.model.AtomDate

  }
 
  @Test
  public void testAtomDate2() {
    String date = "2007-12-13T14:15:16.123Z";
    AtomDate atomDate = new AtomDate(date);
    Calendar calendar = atomDate.getCalendar();
    atomDate = new AtomDate(calendar);
    assertEquals(date,atomDate.toString());
  }
View Full Code Here

Examples of org.apache.abdera.model.AtomDate

  }
 
  @Test
  public void testAtomDate3() {
    long date = System.currentTimeMillis();
    AtomDate atomDate = new AtomDate(date);
    Calendar calendar = atomDate.getCalendar();
    atomDate = new AtomDate(calendar);
    assertEquals(date,atomDate.getTime());
  }
View Full Code Here

Examples of org.apache.abdera.model.AtomDate

    for (String mask : masks) {
      try {
        SimpleDateFormat sdf = new SimpleDateFormat(mask);
        sdf.setTimeZone(TimeZone.getTimeZone("GMT"));
        Date d = sdf.parse(value);
        return new AtomDate(d);
      } catch (Exception e) {}
    }
    return null;
  }
View Full Code Here

Examples of org.apache.abdera.model.AtomDate

        for (String mask : masks) {
            try {
                SimpleDateFormat sdf = new SimpleDateFormat(mask);
                sdf.setTimeZone(TimeZone.getTimeZone("GMT"));
                Date d = sdf.parse(value);
                return new AtomDate(d);
            } catch (Exception e) {
            }
        }
        return null;
    }
View Full Code Here

Examples of org.apache.abdera.model.AtomDate

    }

    public String authenticate(Credentials credentials, HttpMethod method) throws AuthenticationException {
        if (credentials instanceof UsernamePasswordCredentials) {
            UsernamePasswordCredentials creds = (UsernamePasswordCredentials)credentials;
            AtomDate now = new AtomDate(new Date());
            String nonce = generateNonce();
            String digest = generatePasswordDigest(creds.getPassword(), nonce, now);
            String username = creds.getUserName();

            String wsse =
                "UsernameToken Username=\"" + username
                    + "\", "
                    + "PasswordDigest=\""
                    + digest
                    + "\", "
                    + "Nonce=\""
                    + nonce
                    + "\", "
                    + "Created=\""
                    + now.getValue()
                    + "\"";
            if (method != null)
                method.addRequestHeader("X-WSSE", wsse);
            return "WSSE profile=\"UsernameToken\"";
        } else {
View Full Code Here

Examples of org.apache.abdera.model.AtomDate

            _removeAllChildren();
        return this;
    }

    public Date getDate() {
        AtomDate ad = getValue();
        return (ad != null) ? ad.getDate() : null;
    }
View Full Code Here

Examples of org.apache.abdera.model.AtomDate

        AtomDate ad = getValue();
        return (ad != null) ? ad.getDate() : null;
    }

    public Calendar getCalendar() {
        AtomDate ad = getValue();
        return (ad != null) ? ad.getCalendar() : null;
    }
View Full Code Here

Examples of org.apache.abdera.model.AtomDate

        AtomDate ad = getValue();
        return (ad != null) ? ad.getCalendar() : null;
    }

    public long getTime() {
        AtomDate ad = getValue();
        return (ad != null) ? ad.getTime() : null;
    }
View Full Code Here

Examples of org.apache.abdera.model.AtomDate

        AtomDate ad = getValue();
        return (ad != null) ? ad.getTime() : null;
    }

    public String getString() {
        AtomDate ad = getValue();
        return (ad != null) ? ad.getValue() : null;
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.