View Javadoc
1   package org.kuali.ole.docstore.indexer.solr;
2   
3   /**
4    * Created with IntelliJ IDEA.
5    * User: jayabharathreddy
6    * Date: 7/24/13
7    * Time: 4:06 PM
8    * To change this template use File | Settings | File Templates.
9    */
10  public class DocumentLocalId {
11  
12  
13      public static String getDocumentId(String uuid) {
14          if (hasPrefix(uuid)) {
15              String[] prefixes = uuid.split("-");
16              return prefixes[1];
17          }
18          return uuid;
19      }
20  
21      public static boolean hasPrefix(String uuid) {
22          if (uuid != null) {
23              String[] prefixes = uuid.split("-");
24              if (prefixes.length == 2) {
25                  return true;
26              }
27          }
28          return false;
29      }
30  
31      public static String getDocumentIdDisplay(String uuid) {
32          if (hasPrefix(uuid)) {
33              String[] prefixes = uuid.split("-");
34              return prefixes[1];
35          }
36          return uuid;
37      }
38  
39  
40  }