byte[] getContentType() { if (contentType == null) { return null; } else { return stringToBytes(contentType); } }
byte[] getContentType() { if (contentType == null) { return null; } else { return stringToBytes(contentType); } }
private void putInt(byte[] name, int value) { response.put(STAT); response.put(name); response.put(stringToBytes(String.valueOf(value))); response.put(TextCommandConstants.RETURN); }
private void putLong(byte[] name, long value) { response.put(STAT); response.put(name); response.put(stringToBytes(String.valueOf(value))); response.put(TextCommandConstants.RETURN); }
private void putInt(byte[] name, int value) { response.put(STAT); response.put(name); response.put(stringToBytes(String.valueOf(value))); response.put(TextCommandConstants.RETURN); }
private void putLong(byte[] name, long value) { response.put(STAT); response.put(name); response.put(stringToBytes(String.valueOf(value))); response.put(TextCommandConstants.RETURN); }
public UsernamePasswordCredentials(String username, String password) { super(username); checkNotNull(password); this.password = stringToBytes(password); }
/** * Sets the password. * * @param password the password to set */ public void setPassword(String password) { checkNotNull(password); this.password = stringToBytes(password); }
/** * Tests a string to see if it is valid Base64 * * @return true if string is valid Base64, false otherwise */ public static boolean isBase64(String isValidString) { if (isValidString == null) { return false; } return isArrayByteBase64(stringToBytes(isValidString)); }
public UsernamePasswordCredentials(String username, String password) { super(username); checkNotNull(password); this.password = stringToBytes(password); }
/** * Sets the password. * * @param password the password to set */ public void setPassword(String password) { checkNotNull(password); this.password = stringToBytes(password); }
/** * Tests a string to see if it is valid Base64 * * @return true if string is valid Base64, false otherwise */ public static boolean isBase64(String isValidString) { if (isValidString == null) { return false; } return isArrayByteBase64(stringToBytes(isValidString)); }
@Override public void handlerAdded() { initDstBuffer(PROTOCOL_LENGTH, stringToBytes(CLIENT_BINARY_NEW)); }
private void sendResponse(HttpPostCommand command, String value) { command.setResponse(HttpCommand.CONTENT_TYPE_JSON, stringToBytes(value)); textCommandService.sendResponse(command); }
private void handleUpdatePermissions(HttpPostCommand command) { String res = response(ResponseType.FORBIDDEN); command.setResponse(HttpCommand.CONTENT_TYPE_JSON, stringToBytes(res)); return; }
private void handleUpdatePermissions(HttpPostCommand command) { String res = response(ResponseType.FORBIDDEN); command.setResponse(HttpCommand.CONTENT_TYPE_JSON, stringToBytes(res)); return; }
private void handleGetClusterVersion(HttpGetCommand command) { String res = "{\"status\":\"${STATUS}\",\"version\":\"${VERSION}\"}"; Node node = textCommandService.getNode(); ClusterService clusterService = node.getClusterService(); res = res.replace("${STATUS}", "success"); res = res.replace("${VERSION}", clusterService.getClusterVersion().toString()); command.setResponse(HttpCommand.CONTENT_TYPE_JSON, stringToBytes(res)); }
private void handleGetClusterVersion(HttpGetCommand command) { String res = "{\"status\":\"${STATUS}\",\"version\":\"${VERSION}\"}"; Node node = textCommandService.getNode(); ClusterService clusterService = node.getClusterService(); res = res.replace("${STATUS}", "success"); res = res.replace("${VERSION}", clusterService.getClusterVersion().toString()); command.setResponse(HttpCommand.CONTENT_TYPE_JSON, stringToBytes(res)); }
@Override public void writeData(ObjectDataOutput out) throws IOException { out.writeInt(port); out.write(type); if (host != null) { byte[] address = stringToBytes(host); out.writeInt(address.length); out.write(address); } else { out.writeInt(0); } }
@Override public void writeData(ObjectDataOutput out) throws IOException { out.writeInt(port); out.write(type); if (host != null) { byte[] address = stringToBytes(host); out.writeInt(address.length); out.write(address); } else { out.writeInt(0); } }