/** * Converts an instance of java.util.Date into a String using the date * format: yyyy-MM-ddTHH:mm:ss.SSSZ. * * @param date * Instance of java.util.Date. * @return ISO 8601 String representation (yyyy-MM-ddTHH:mm:ss.SSSZ) of the * Date argument or null if the Date argument is null. */ public static String convertDateToString(Date date) { return convertDateToString(date, true); }
/** * Converts a datetime string into and instance of java.util.Date using the * date format: yyyy-MM-ddTHH:mm:ss.SSSZ. * * @param dateTime * A datetime string * @return Corresponding instance of java.util.Date (returns null if * dateTime string argument is empty string or null) */ public static Date convertStringToDate(String dateTime) { return parseDateLoose(dateTime); }
public static Transformer getTransformer() throws Exception { return getTransformer(null); } public static Transformer getTransformer(Source src) throws Exception {
@Test public void testEncodeToStringByteArray() { assertEquals(FOO_STRING_ENCODED, Base64.encodeToString(FOO_BYTES)); }
public void normalize() { normalizeSyntax(); normalizeByScheme(); normalizeByProtocol(); }
/** * Encodes an input stream to base64, returning a string. * <p> * The stream is guaranteed to be closed when this method returns, whether * successful or not. * * @param in stream to encode * return encoded string, or null if there's an error reading the stream */ public static String encodeToString(InputStream in) { return getString(encode(in)); }
/** * Performs the following: * Case Normalization * Percent-Encoding Normalization * Path Segment Normalization * */ public void normalizeSyntax() { normalizeCase(); normalizePercentEncoding(); normalizePathSegment(); }
public static void serialize(InputStream in, OutputStream out, boolean prettyPrint) throws Exception { Document document = getDocument(in); serialize(document, out, prettyPrint); }
protected String getWhenString(Date versDateTime) { if (versDateTime != null) { return DateUtility.formatMillisTZ(versDateTime); } else { return "the current time"; } }
public static Process execCommandLineUtility(String cmd, OutputStream out, OutputStream err) { return execCommandLineUtility(new String[] {cmd}, out, err); }
@Override public boolean equals(Object o) { if (o instanceof FileComparator) { FileComparator c = (FileComparator) o; return descends() == c.descends() && ignoresCase() == c.ignoresCase(); } else { return false; } }
public static Process exec(String cmd, File dir, OutputStream out, OutputStream err) { return exec(new String[] {cmd}, dir, out, err); }
/** * Converts an instance of java.util.Date into a String using the date * format: yyyy-MM-ddTHH:mm:ss.SSSZ. * * @param date * Instance of java.util.Date. * @return ISO 8601 String representation (yyyy-MM-ddTHH:mm:ss.SSSZ) of the * Date argument or null if the Date argument is null. */ public static String convertDateToString(Date date) { return convertDateToString(date, true); }
/** * Converts a datetime string into and instance of java.util.Date using the * date format: yyyy-MM-ddTHH:mm:ss.SSSZ. * * @param dateTime * A datetime string * @return Corresponding instance of java.util.Date (returns null if * dateTime string argument is empty string or null) */ public static Date convertStringToDate(String dateTime) { return parseDateLoose(dateTime); }
public void normalize() { normalizeSyntax(); normalizeByScheme(); normalizeByProtocol(); }
public static void serialize(InputStream in, OutputStream out, boolean prettyPrint) throws Exception { Document document = getDocument(in); serialize(document, out, prettyPrint); }
protected String getWhenString(Date versDateTime) { if (versDateTime != null) { return DateUtility.formatMillisTZ(versDateTime); } else { return "the current time"; } }