public String encode(String text) throws IOException { // Right now, we still use the legacy encoding. // This will be changed in the incoming months return zlib.encode(text); } }
public String encode(String text) throws IOException { // Right now, we still use the legacy encoding. // This will be changed in the incoming months return zlib.encode(text); } }
public String getEncodedUrl() throws IOException { final Transcoder transcoder = TranscoderUtil.getDefaultTranscoder(); final String source = getDiagram().getSource().getPlainString(); final String encoded = transcoder.encode(source); return encoded; }
public String encode(String text) throws IOException { return zlib.encode(text); } }
public String encode(String source) { String text = null; Transcoder transcoder = TranscoderUtil.getDefaultTranscoder(); try { text = transcoder.encode(source); } catch (IOException ioe) { text = "' unable to encode string"; } try { text = URLEncoder.encode(text, "UTF-8"); } catch (UnsupportedEncodingException uee) { text = "' invalid encoded string"; } return text; } }
/** * Converts all lines of a plant UML diagram block to an encoded string which * can be sent to a plantuml server. * * @param paramDiagramContentLines - List - the lines of the diagram block * @return String - the encoded string */ private String convertPlantUMLLines(List<String> paramDiagramContentLines) { String result = ""; if (paramDiagramContentLines != null) { StringBuilder toConvert = new StringBuilder(); for (String line : paramDiagramContentLines) { toConvert.append(line); toConvert.append(System.lineSeparator()); } try { result = TranscoderUtil.getDefaultTranscoder().encode(toConvert.toString()); } catch (IOException e) { LOGGER.severe("Transcoding to PlantUML failed. Error is " + e.getMessage()); } } return result; }
public List<String> getEncodedUrl() throws IOException { final List<String> result = new ArrayList<String>(); final Transcoder transcoder = TranscoderUtil.getDefaultTranscoder(); for (BlockUml blockUml : builder.getBlockUmls()) { final String source = blockUml.getDiagram().getSource().getPlainString(); final String encoded = transcoder.encode(source); result.add(encoded); } return Collections.unmodifiableList(result); }
public List<String> getEncodedUrl() throws IOException { final List<String> result = new ArrayList<String>(); final Transcoder transcoder = TranscoderUtil.getDefaultTranscoder(); for (BlockUml blockUml : builder.getBlockUmls()) { final String source = blockUml.getDiagram().getSource().getPlainString(); final String encoded = transcoder.encode(source); result.add(encoded); } return Collections.unmodifiableList(result); }