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); } }
return zlibBase64.decode(code.substring(2)); return brotliBase64.decode(code.substring(2)); return base64only.decode(code.substring(2)); return hexOnly.decode(code.substring(2)); return zlibBase64.decode(code.substring("-deflate-".length())); return brotliBase64.decode(code.substring("-brotli-".length())); return base64only.decode(code.substring("-base64-".length())); return hexOnly.decode(code.substring("-hex-".length())); return brotli.decode(code.substring(1)); return zlib.decode(code); } catch (Exception ex) { return oldOne.decode(code);
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); } }
return zlibBase64.decode(code.substring(2)); return brotliBase64.decode(code.substring(2)); return base64only.decode(code.substring(2)); return hexOnly.decode(code.substring(2)); return zlibBase64.decode(code.substring("-deflate-".length())); return brotliBase64.decode(code.substring("-brotli-".length())); return base64only.decode(code.substring("-base64-".length())); return hexOnly.decode(code.substring("-hex-".length())); return brotli.decode(code.substring(1)); return zlib.decode(code); } catch (Exception ex) { return oldOne.decode(code);
public String getEncodedUrl() throws IOException { final Transcoder transcoder = TranscoderUtil.getDefaultTranscoder(); final String source = getDiagram().getSource().getPlainString(); final String encoded = transcoder.encode(source); return encoded; }
private List<String> getDonors() throws IOException { final List<String> lines = new ArrayList<String>(); final Transcoder t = new TranscoderImpl(new AsciiEncoder(), new StringCompressorNone(), new CompressionBrotli()); final String s = t.decode(DONORS).replace('*', '.'); final StringTokenizer st = new StringTokenizer(s, BackSlash.NEWLINE); while (st.hasMoreTokens()) { lines.add(st.nextToken()); } return lines; }
public String encode(String text) throws IOException { return zlib.encode(text); } }
final Transcoder transcoder = TranscoderUtil.getDefaultTranscoder(); System.out.println("@startuml"); System.out.println(transcoder.decode(s)); System.out.println("@enduml"); } else {
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; }
private List<String> getDonors() throws IOException { final List<String> lines = new ArrayList<String>(); final Transcoder t = new TranscoderImpl(); final String s = t.decode(DONORS).replace('*', '.'); final StringTokenizer st = new StringTokenizer(s, "\n"); while (st.hasMoreTokens()) { lines.add(st.nextToken()); } return lines; }
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 String decode(String source) { String uml; try { uml = URLDecoder.decode(source, "UTF-8"); } catch (UnsupportedEncodingException uee) { uml = "' invalid encoded string"; } Transcoder transcoder = TranscoderUtil.getDefaultTranscoder(); try { uml = transcoder.decode(uml); } catch (IOException ioe) { uml = "' unable to decode string"; } return uml; }
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); }
final Transcoder transcoder = TranscoderUtil.getDefaultTranscoder(); System.out.println("@startuml"); System.out.println(transcoder.decode(s)); System.out.println("@enduml"); } else {