public static String formatUUID(byte[] uuid) { if (uuid.length < 16) { byte[] tmpBuf = new byte[16]; Arrays.fill(tmpBuf, (byte) 0); System.arraycopy(uuid, 0, tmpBuf, 0, uuid.length); uuid = tmpBuf; } String[] hexNumbers = new String[16]; for (int i = 0; i < 16; i++) { hexNumbers[i] = SVNFormatUtil.getHexNumberFromByte(uuid[i]); } String formatString = "{0}{1}{2}{3}-{4}{5}-{6}{7}-{8}{9}-{10}{11}{12}{13}{14}{15}"; Object args = hexNumbers; return MessageFormat.format(formatString, (Object[]) args); }
protected boolean writeString(Writer writer, String str, int emptyFields) throws IOException { if (str != null && str.length() > 0) { for (int i = 0; i < emptyFields; i++) { writer.write('\n'); } for (int i = 0; i < str.length(); i++) { char ch = str.charAt(i); if (SVNEncodingUtil.isASCIIControlChar(ch) || ch == '\\') { writer.write("\\x"); writer.write(SVNFormatUtil.getHexNumberFromByte((byte)ch)); } else { writer.write(ch); } } writer.write('\n'); return true; } return false; }
protected boolean writeString(Writer writer, String str, int emptyFields) throws IOException { if (str != null && str.length() > 0) { for (int i = 0; i < emptyFields; i++) { writer.write('\n'); } for (int i = 0; i < str.length(); i++) { char ch = str.charAt(i); if (SVNEncodingUtil.isASCIIControlChar(ch) || ch == '\\') { writer.write("\\x"); writer.write(SVNFormatUtil.getHexNumberFromByte((byte)ch)); } else { writer.write(ch); } } writer.write('\n'); return true; } return false; }
protected boolean writeString(Writer writer, String str, int emptyFields) throws IOException { if (str != null && str.length() > 0) { for (int i = 0; i < emptyFields; i++) { writer.write('\n'); } for (int i = 0; i < str.length(); i++) { char ch = str.charAt(i); if (SVNEncodingUtil.isASCIIControlChar(ch) || ch == '\\') { writer.write("\\x"); writer.write(SVNFormatUtil.getHexNumberFromByte((byte)ch)); } else { writer.write(ch); } } writer.write('\n'); return true; } return false; }
private boolean writeString(Writer writer, String str, int emptyFields) throws IOException { if (str != null && str.length() > 0) { for (int i = 0; i < emptyFields; i++) { writer.write('\n'); } for (int i = 0; i < str.length(); i++) { char ch = str.charAt(i); if (SVNEncodingUtil.isASCIIControlChar(ch) || ch == '\\') { writer.write("\\x"); writer.write(SVNFormatUtil.getHexNumberFromByte((byte)ch)); } else { writer.write(ch); } } writer.write('\n'); return true; } return false; }
public static void checkPathIsValid(String path) throws SVNException { for (int i = 0; i < path.length(); i++) { char ch = path.charAt(i); if (SVNEncodingUtil.isASCIIControlChar(ch)) { SVNErrorMessage err = SVNErrorMessage.create(SVNErrorCode.FS_PATH_SYNTAX, "Invalid control character ''{0}'' in path ''{1}''", new String[] {"''0x" + SVNFormatUtil.getHexNumberFromByte((byte)ch) + "''", path}); SVNErrorManager.error(err); } } }
public static void checkPathIsValid(String path) throws SVNException { for (int i = 0; i < path.length(); i++) { char ch = path.charAt(i); if (SVNEncodingUtil.isASCIIControlChar(ch)) { SVNErrorMessage err = SVNErrorMessage.create(SVNErrorCode.FS_PATH_SYNTAX, "Invalid control character ''{0}'' in path ''{1}''", new String[]{"0x" + SVNFormatUtil.getHexNumberFromByte((byte) ch), path}); SVNErrorManager.error(err, SVNLogType.DEFAULT); } } }
public static void checkPathIsValid(String path) throws SVNException { for (int i = 0; i < path.length(); i++) { char ch = path.charAt(i); if (SVNEncodingUtil.isASCIIControlChar(ch)) { SVNErrorMessage err = SVNErrorMessage.create(SVNErrorCode.FS_PATH_SYNTAX, "Invalid control character ''{0}'' in path ''{1}''", new String[]{"0x" + SVNFormatUtil.getHexNumberFromByte((byte) ch), path}); SVNErrorManager.error(err, SVNLogType.DEFAULT); } } }
public static void checkPathIsValid(String path) throws SVNException { for (int i = 0; i < path.length(); i++) { char ch = path.charAt(i); if (SVNEncodingUtil.isASCIIControlChar(ch)) { SVNErrorMessage err = SVNErrorMessage.create(SVNErrorCode.FS_PATH_SYNTAX, "Invalid control character ''{0}'' in path ''{1}''", new String[]{"0x" + SVNFormatUtil.getHexNumberFromByte((byte) ch), path}); SVNErrorManager.error(err, SVNLogType.DEFAULT); } } }
String hexDigest = ""; for (int i = 0; i < result.length; i++) { hexDigest += SVNFormatUtil.getHexNumberFromByte(result[i]);
String hexDigest = ""; for (int i = 0; i < result.length; i++) { hexDigest += SVNFormatUtil.getHexNumberFromByte(result[i]);
String hexDigest = ""; for (int i = 0; i < result.length; i++) { hexDigest += SVNFormatUtil.getHexNumberFromByte(result[i]);
log.append(SVNFormatUtil.getHexNumberFromByte(myNonce[i]));
log.append(SVNFormatUtil.getHexNumberFromByte(myNonce[i]));
log.append(SVNFormatUtil.getHexNumberFromByte(myNonce[i]));
log.append(SVNFormatUtil.getHexNumberFromByte(myNonce[i]));