File tree Expand file tree Collapse file tree 2 files changed +28
-14
lines changed
src/main/java/ml/anon/annotation Expand file tree Collapse file tree 2 files changed +28
-14
lines changed Original file line number Diff line number Diff line change 1+ package ml .anon .annotation ;
2+
3+ import ml .anon .model .anonymization .Label ;
4+ import org .springframework .http .ResponseEntity ;
5+ import org .springframework .web .client .RestTemplate ;
6+ import org .springframework .web .util .UriUtils ;
7+
8+ import java .io .UnsupportedEncodingException ;
9+ import java .net .URI ;
10+
11+ /**
12+ * Created by mirco on 13.06.17.
13+ */
14+ public class ReplacementAccess {
15+
16+ private RestTemplate template = new RestTemplate ();
17+
18+ public String generateReplacement (String original , Label label ) throws UnsupportedEncodingException {
19+ String l = label == null ? "MISC" : label .toString ();
20+
21+ StringBuilder builder = new StringBuilder ("http://127.0.0.1:9001/replacement" ).append ("?original=" )
22+ .append (UriUtils .encode (original , "UTF-8" )).append ("&label=" ).append (l );
23+ String url = builder .toString ();
24+
25+ ResponseEntity <String > repl = template .getForEntity (url , String .class );
26+ return repl .getBody ();
27+ }
28+ }
Load Diff This file was deleted.
You can’t perform that action at this time.
0 commit comments