/** * Set the content of device's clipboard. * * @param label clipboard data label. * @param contentType one of supported content types. * @param base64Content base64-encoded content to be set. */ default void setClipboard(String label, ClipboardContentType contentType, byte[] base64Content) { String[] parameters = new String[]{"content", "contentType", "label"}; Object[] values = new Object[]{new String(checkNotNull(base64Content), StandardCharsets.UTF_8), contentType.name().toLowerCase(), checkNotNull(label)}; CommandExecutionHelper.execute(this, new AbstractMap.SimpleEntry<>(SET_CLIPBOARD, prepareArguments(parameters, values))); }
/** * Set the content of device's clipboard. * * @param contentType one of supported content types. * @param base64Content base64-encoded content to be set. */ default void setClipboard(ClipboardContentType contentType, byte[] base64Content) { String[] parameters = new String[]{"content", "contentType"}; Object[] values = new Object[]{new String(checkNotNull(base64Content), StandardCharsets.UTF_8), contentType.name().toLowerCase()}; CommandExecutionHelper.execute(this, new AbstractMap.SimpleEntry<>(SET_CLIPBOARD, prepareArguments(parameters, values))); }
/** * Get the content of the clipboard. * * @param contentType one of supported content types. * @return the actual content of the clipboard as base64-encoded string or an empty string if the clipboard is empty */ default String getClipboard(ClipboardContentType contentType) { return CommandExecutionHelper.execute(this, new AbstractMap.SimpleEntry<>(GET_CLIPBOARD, prepareArguments("contentType", contentType.name().toLowerCase()))); }
/** * Set the content of device's clipboard. * * @param contentType one of supported content types. * @param base64Content base64-encoded content to be set. */ default void setClipboard(ClipboardContentType contentType, byte[] base64Content) { String[] parameters = new String[]{"content", "contentType"}; Object[] values = new Object[]{new String(checkNotNull(base64Content), StandardCharsets.UTF_8), contentType.name().toLowerCase()}; CommandExecutionHelper.execute(this, new AbstractMap.SimpleEntry<>(SET_CLIPBOARD, prepareArguments(parameters, values))); }
/** * Set the content of device's clipboard. * * @param label clipboard data label. * @param contentType one of supported content types. * @param base64Content base64-encoded content to be set. */ default void setClipboard(String label, ClipboardContentType contentType, byte[] base64Content) { String[] parameters = new String[]{"content", "contentType", "label"}; Object[] values = new Object[]{new String(checkNotNull(base64Content), StandardCharsets.UTF_8), contentType.name().toLowerCase(), checkNotNull(label)}; CommandExecutionHelper.execute(this, new AbstractMap.SimpleEntry<>(SET_CLIPBOARD, prepareArguments(parameters, values))); }
/** * Get the content of the clipboard. * * @param contentType one of supported content types. * @return the actual content of the clipboard as base64-encoded string or an empty string if the clipboard is empty */ default String getClipboard(ClipboardContentType contentType) { return CommandExecutionHelper.execute(this, new AbstractMap.SimpleEntry<>(GET_CLIPBOARD, prepareArguments("contentType", contentType.name().toLowerCase()))); }