Changeset 50:64aa756c60cc in AnnotationManagerN4J for src/main/java/de/mpiwg/itgroup/annotations/Annotation.java
Legend:
- Unmodified
- Added
- Removed
-
src/main/java/de/mpiwg/itgroup/annotations/Annotation.java
r48 r50 4 4 package de.mpiwg.itgroup.annotations; 5 5 6 import java.io.UnsupportedEncodingException; 6 7 import java.util.Set; 8 9 import org.apache.commons.codec.binary.Base64; 7 10 8 11 import de.mpiwg.itgroup.annotations.neo4j.AnnotationStore; … … 161 164 162 165 /** 166 * Returns an URL-compatible id. 167 * Currently the uri as base64 encoded string. 168 * @return 169 */ 170 public String getUrlId() { 171 if (uri == null) return null; 172 try { 173 return Base64.encodeBase64URLSafeString(uri.getBytes("UTF-8")); 174 } catch (UnsupportedEncodingException e) { 175 return null; 176 } 177 } 178 179 public static String decodeId(String id) { 180 if (id == null) return null; 181 try { 182 return new String(Base64.decodeBase64(id), "UTF-8"); 183 } catch (UnsupportedEncodingException e) { 184 return null; 185 } 186 } 187 188 /** 163 189 * @return the bodyText 164 190 */
Note: See TracChangeset
for help on using the changeset viewer.