1 5 6 package org.exoplatform.services.jcr.impl.storage.filesystem; 7 8 9 import org.apache.commons.codec.binary.Base64; 10 import org.exoplatform.services.jcr.core.NodeData; 11 import org.exoplatform.services.jcr.core.ReferenceableNodeLocation; 12 import org.exoplatform.services.jcr.impl.storage.BaseRepositoryManager; 13 import javax.jcr.PathNotFoundException; 14 15 import java.util.HashSet ; 16 import java.util.Set ; 17 18 19 25 26 public class SimpleFsRepositoryManagerImpl extends BaseRepositoryManager { 27 28 private static long id = System.currentTimeMillis(); 29 30 31 public SimpleFsRepositoryManagerImpl(String name) { 32 } 33 34 synchronized public String generateUUID(NodeData context) { 35 try { 36 String uuid = new String (Base64.encodeBase64(context.getPath().getBytes())); 37 return uuid; 38 } catch (Exception e) { 39 throw new RuntimeException ("Unexpected IO Exception " + e.getMessage()); 40 } 41 } 42 43 synchronized public ReferenceableNodeLocation getLocationByUUID(String workspaceContainerName, String UUID) throws PathNotFoundException { 44 String path = new String (Base64.decodeBase64(UUID.getBytes())); 45 return new ReferenceableNodeLocation(path, UUID, path); 46 } 47 48 synchronized public ReferenceableNodeLocation getLocationByPath(String workspaceContainerName, String path) throws PathNotFoundException { 49 String uuid = new String (Base64.encodeBase64(path.getBytes())); 50 return new ReferenceableNodeLocation(path, uuid, path); 51 } 52 53 synchronized public void addLocation(String workspaceContainerName, String UUID, String path, boolean isNew) { 54 } 55 56 synchronized public void deleteLocationByPath(String workspaceContainerName, String path) { 57 } 58 59 synchronized public void deleteLocationByUUID(String workspaceContainerName, String UUID) { 60 } 61 62 synchronized public void addWorkspaceContainer(String workspaceContainerName) { 63 } 64 65 93 } 94 | Popular Tags |